Package convex.net
Class ResultConsumer
java.lang.Object
convex.net.ResultConsumer
Consumer abstract base class for awaiting results.
Provides basic buffering of:
- Missing data until all data is available.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
handleError(long id, ACell code, ACell errorMessage)
Method called when an error result is received.protected void
handleNormalResult(long id, ACell value)
Method called when a normal (non-error) result is received.protected void
handleResult(long id, Result result)
Handler for a fully received Result.protected void
Unbuffer and replay messages for a given hash
-
Constructor Details
-
ResultConsumer
public ResultConsumer()
-
-
Method Details
-
accept
-
unbuffer
Unbuffer and replay messages for a given hash- Parameters:
hash
-
-
handleResult
Handler for a fully received Result. May be overridden.- Parameters:
id
- ID of message receivedresult
- Result value
-
handleError
Method called when an error result is received. May be overriden. Default behaviour is simply to log the error. If this method throws a MissingDataException, missing data is requested and the result handling may be retried later.- 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. If this method throws a MissingDataException, missing data is requested and the result handling may be retried later.- Parameters:
id
- The ID of the original message to which this result correspondsvalue
- The result value
-