Future
A Future represents a pending asynchronous result from a remote
operation. Created by RemoteProcess>>asyncSend:with:.
Use await to block until the result is available. Use isResolved
to check without blocking. Use result to get the value if resolved.
| future <Future> result <Integer> |
future := worker asyncSend: #compute: with: 42.
future isResolved "=> false (initially)"
result := future await. "=> blocks until resolved"
future isResolved "=> true"
Instance Methods
uncategorized
Block the current process until the Future resolves.
Returns the result value. If the remote side returned an
error, returns nil (check error for the error message).
future await "=> the result value"
Block for at most ms milliseconds. Returns the result
value if resolved in time, or nil on timeout.
future await: 5000 "=> result or nil"
Return the error message string if the Future resolved with an error, or nil if successful or still pending.
Return true if the Future has been resolved (success or error).
future isResolved "=> true/false"
Return a string representation.
Return the result value if resolved, or nil if still pending. Does not block.