public interface OperationListener
OperationListener
interface defines the mechanism for receiving notifications
about the completion of asynchronous operations within the com.cloudpos package.
Implementing this interface allows an object to be registered as a listener to receive
updates about the outcomes of these operations.
Asynchronous methods in device operations often involve processes that run independently
of the main execution flow. The OperationListener
serves as a callback mechanism,
allowing the system to notify when an asynchronous operation has concluded. This pattern is
particularly useful in environments where non-blocking operations are critical.
Implementers of this interface should handle the results of asynchronous operations
within the handleResult
method. This method is called automatically when an
asynchronous operation completes, providing an OperationResult
object that contains
details about the outcome of the operation.
OperationResult
Modifier and Type | Method and Description |
---|---|
void |
handleResult(OperationResult result)
Called when an asynchronous operation completes.
|
void handleResult(OperationResult result)
result
- The OperationResult
object representing the outcome of the
asynchronous operation. This object contains details such as the
success or failure status and any relevant data produced by the operation.