Package convex.net
Class ResultConsumer
java.lang.Object
convex.net.ResultConsumer
Consumer abstract base class for awaiting results.
Provides basic buffering of results until all data is available.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
handleError(long id, Object code, Object errorMessage)
Method called when an error result is received.protected void
handleError(Object code, Object errorMessage)
Method called when an error result is received.protected void
handleResult(long id, Object value)
Method called when a normal (non-error) result is received.protected void
handleResult(Object value)
Method called when a normal (non-error) result is received.protected void
Method called when a result is received.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
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
-
handleResult
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:
value
- The result value
-
handleResultMessage
Method called when a result is received. By default, delegates to handleResult and handleError -
handleError
Method called when an error result is received. 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)
-
handleError
Method called when an error result is received. 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:
code
- The error code received. May not be null, and is usually a KeyworderrorMessage
- The error message associated with the result (may be null)
-