Call
An abstraction over a RPC call to pCloud's API servers.
A Call object resemebles a future request to execute a method having the following properties:
- Allows for asynchronous execution by the enqueue method with a Callback object.
- Allows for synchronous execution on the same thread by calling the execute method.
- Can be executed only once, state can be checked via the isExecuted property.
- Once created, a Call instance can be cloned via the clone method and executed again.
- Executed calls can be cancelled via the cancel method. It is safe to call cancel multiple times.
- Running calls that are being cancelled will result in an IOException being thrown or reported via onFailure.
Parameters
<T>
the type of the returned result