java.lang.Object
convex.net.ResultConsumer
Consumer abstract base class for default behaviour when awaiting results.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
handleError
(ACell id, ACell code, ACell errorMessage) Method called when an error result is received.protected void
handleNormalResult
(ACell id, ACell value) Method called when a normal (non-error) result is received.protected void
handleResult
(ACell id, Result result) Handler for a fully received Result.
-
Constructor Details
-
ResultConsumer
public ResultConsumer()
-
-
Method Details
-
accept
-
handleResult
Handler for a fully received Result. May be overridden.- Parameters:
id
- ID of message received (or -1 if no message ID present)result
- Result value
-
handleError
Method called when an error result is received. May be overriden. Default behaviour is simply to log the error.- Parameters:
id
- The ID of the original message to which this result correspondscode
- The error code received. May not be null, and is usually a KeyworderrorMessage
- The error message associated with the result (may be null)
-
handleNormalResult
Method called when a normal (non-error) result is received.- Parameters:
id
- The ID of the original message to which this result correspondsvalue
- The result value
-