Class PushCallbackTask
- All Implemented Interfaces:
Comparable<Object>
The worker-posting helper of PUSH-PROPS-DESIGN section 5: a callback or a listener event posted to the session's worker as a
WorkerTask with a WorkerTaskEnded callback, never run on the calling thread, with the disposal rule of design section 6.2 applied at every stage - the session disposed before the post, the worker refusing the post, the session disposed before the task ran, the task cancelled by the worker's disposal or abandoned by the API's - and each such case logged ONCE at INFO as "not completed".The task runs the callback in its own try/catch: a callback that throws is logged SEVERE and neither reaches the worker nor stops the session.
MEASURED (P4-04, PushSessionAPITest): WorkerTask.cancel calls the task-ended callback only while the task is NOT_STARTED, and Worker.post marks a task POSTED before queueing it, so a queued task cancelled by Worker.dispose never informs its callback - contrary to both JavaDocs. The API therefore keeps its own set of pending tasks and abandons them at its disposal (abandon(String)); the task-ended callback is kept as well, so the line is logged whichever path runs first and never twice.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from class WorkerTask
WorkerTask.StateField Summary
Fields inherited from class WorkerTask
createTime, PRIORITY_DEFAULT, PRIORITY_HIGHEST, PRIORITY_LOWESTMethod Summary
Methods inherited from class WorkerTask
cancel, compareTo, execute, getEndTime, getException, getID, getModalID, getParam, getResult, getStartTime, getState, getWorker, isCanceled, isCancelled, setCallback, waitForTaskEnded, waitForTaskEnded
Method Details
execute
Description copied from class:WorkerTaskStart execution of the task with the implementation specific task ID and parameter.- Specified by:
executein classWorkerTask<String,Void, Void> - Parameters:
operation- The implementation specific task ID.param- The implementation specific parameter, or null for none.- Returns:
- The return code.