… | |
… | |
383 | msg1 => sub { ... }, |
383 | msg1 => sub { ... }, |
384 | ... |
384 | ... |
385 | ; |
385 | ; |
386 | |
386 | |
387 | Example: temporarily register a rcv callback for a tag matching some port |
387 | Example: temporarily register a rcv callback for a tag matching some port |
388 | (e.g. for a rpc reply) and unregister it after a message was received. |
388 | (e.g. for an rpc reply) and unregister it after a message was received. |
389 | |
389 | |
390 | rcv $port, $otherport => sub { |
390 | rcv $port, $otherport => sub { |
391 | my @reply = @_; |
391 | my @reply = @_; |
392 | |
392 | |
393 | rcv $SELF, $otherport; |
393 | rcv $SELF, $otherport; |