Product Site

5.1.2.10. notify

Requests notification about the completion of processing of the message.

The notification target must be an object that implements the MessageNotification interface. Upon completion of message processing, target will be sent a messageComplete message, with the completed Message object as argument source.

Any number of notifications can be requested for a message.

To retrieve the result of the completed message, use method result.

See also class MessageNotification.

Example 5.22. Message class — notify method
msg = .Message~new(.Array~new(1000)~fill(0)~allIndexes, "sort")
msg~notify(.Sorter~new)
msg~start
say "processing continues"

::class Sorter inherit MessageNotification
::method messageComplete
  use strict arg message

  say message~target~items "items sorted"

will output
processing continues
1000 items sorted