RemoteProcess
Inherits from: Object
Instance variables:
node, name
A reference to a process on a remote Maggie node. Created via
Node>>processNamed:. Supports fire-and-forget messaging
(cast:with:) and request-response (asyncSend:with:).
Example
| node <Node> worker <RemoteProcess> future <Future> result <Integer> |
node := Node connect: 'localhost:8081'.
worker := node processNamed: 'compute'.
"Fire-and-forget"
worker cast: #logEvent: with: eventData.
"Request-response (returns a Future)"
future := worker asyncSend: #compute: with: 42.
result := future await.
Instance Methods
primitives
primAsyncSend:with:
primCast:with:
primName
primNode
uncategorized
asyncSend:with:
Request-response: send a message and return a Future that will
resolve with the remote process's response. Use await on the
Future to block until the result is available.
Example
| future <Future> |
future := worker asyncSend: #compute: with: 42.
future await "=> the result from the remote side"
cast:with:
Fire-and-forget: send a message to the remote process without waiting for a response. Returns true if the send was initiated.
Example
worker cast: #log: with: 'hello'
name
The name of the remote process.
node
The Node connection this process belongs to.
printString
Return a string representation.