ReturnObject and ReturnInfoObject (Daemon subroutines)

From m204wiki
Jump to navigation Jump to search

Specify objects returned to the master thread (Daemon class)

ReturnObject and ReturnInfoObject specify the output objects to be returned to the master thread. The difference between them is that ReturnObject returns the value of the Output argument of the Run function, while ReturnInfoObject returns the value of the Info argument of the Run function.


%(Daemon):ReturnObject( outputObj)

%(Daemon):ReturnInfoObject( outputObj)

Syntax terms

%(Daemon) The class name in parentheses denotes a shared method. ReturnObject and ReturnInfoObject can also be invoked via a Daemon object variable, which may be null.
outputObj The object returned from the daemon method object in the last Run method invocation. outputObj must be deep copyable, as described in "Copying objects".

Usage notes

  • ReturnObject and ReturnInfoObject can only be issued on daemon threads.
  • You can invoke ReturnObject and/or ReturnInfoObject as many times as you want for a single Run call. Each subsequent invocation replaces the object from the previous invocation of the same method.
  • You can invoke ReturnObject even if Run has no output parameter, and you can invoke ReturnInfoObject even if Run has no Info parameter.
  • A class mismatch between the ReturnObject argument and the Run output argument, or between the ReturnInfoObject argument and the Run Info argument, causes request cancellation in the master thread at the time the daemon finishes and Run method was about to return.

See also