class Flor::Pro::Trap
Would it be worth the pain implementing bind:?
Public Instance Methods
Source
# File lib/flor/punit/trap.rb, line 225 def pre_execute @node['vars'] = {} @node['atts'] = [] @node['fun'] = nil #unatt_unkeyed_children end
Source
# File lib/flor/punit/trap.rb, line 291 def receive return [] if @node['trapped'] super end
Calls superclass method
Flor::Procedure#receive
Source
# File lib/flor/punit/trap.rb, line 234 def receive_non_att fun = @fcid > 0 ? payload['ret'] : nil points = att_a('point', 'points', nil) tags = att_a('tag', 'tags', nil) heats = att_a('heat', 'heats', nil) heaps = att_a('heap', 'heaps', nil) names = att_a('name', 'names', nil) pl = att('payload', 'pl') || 'trap' points = att_a(nil, nil) unless points || tags points = [ 'entered' ] if tags && ! points att_a('sig', 'signal', 'signals', []) .each { |sig| (points ||= []) << 'signal'; (names ||= []) << sig } points = points.uniq if points names = names.uniq if names bnid = att('bnid', 'bind') || parent || '0' msg = if fun apply(fun, [], tree[2], anid: false).first else wrap_reply.first end tra = {} tra['nid'] = nid tra['bnid'] = bnid tra['points'] = points tra['tags'] = tags tra['heaps'] = heaps tra['heats'] = heats tra['names'] = names tra['message'] = msg tra['pl'] = pl count = att('count') count = 1 if fun == nil # blocking mode implies count: 1 tra['count'] = count if count tra['range'] = att('range', 'scope') || 'subnid' @node['trapped'] = true wrap('point' => 'trap', 'nid' => nid, 'trap' => tra) + (fun ? flank : []) end
Source
# File lib/flor/punit/trap.rb, line 301 def wrap_cancel_children(h={}) h['flavour'] == 'kill' ? super : [] end
“trap” keeps track of its children, but does not cascade ‘cancel’ to them, unless the cancel flavour is ‘kill’.
Calls superclass method
Flor::Procedure#wrap_cancel_children