Package com.cloudinary.android
Interface RequestDispatcher
public interface RequestDispatcher
Entry point to dispatch new upload requests.
-
Method Summary
Modifier and Type Method Description intcancelAllRequests()Cancels all upload requests.booleancancelRequest(java.lang.String requestId)Cancel an upload request.java.lang.Stringdispatch(UploadRequest request)Dispatch a new upload request.voidqueueRoomFreed()Called every time a request finishes, meaning there's room for new requests.java.lang.StringstartNow(android.content.Context context, UploadRequest request)Run an upload request immediately ignoring all constraints.
-
Method Details
-
dispatch
Dispatch a new upload request. Will get queued and handled based on network policy, phone policy and time constraints. For immediate requests or preprocessing, a context needs to be provided. -
startNow
Run an upload request immediately ignoring all constraints. Note: Requests that run through here are never rescheduled.- Parameters:
request- The request to runcontext- Android context, required for immediate requests.- Returns:
- The request id.
-
cancelRequest
boolean cancelRequest(java.lang.String requestId)Cancel an upload request.- Parameters:
requestId- Id of the request to cancel.- Returns:
- True if the request was found and cancelled successfully.
-
queueRoomFreed
void queueRoomFreed()Called every time a request finishes, meaning there's room for new requests. -
cancelAllRequests
int cancelAllRequests()Cancels all upload requests.- Returns:
- The count of canceled requests and running jobs.
-