Scheduler and Job classes refactoring
Context
In order in ease the integration of new features like job cancellation of scheduler instrumentation, the Job and Scheduler class would benefit from a refactoring.
Task Description
-
Refactor the Jobclass for better encapsulation and new public interface:-
Job.register_client()andJob.unregister_client(): add/remove an operation watcher. -
Job.set_cached_result(): manually associate a result that comes from the action cache. -
Job.create_lease()andJob.update_lease_state(): lease state manipulation API for the scheduler. -
Job.cancel_lease(): lease cancellation call. -
Job.update_operation_stage(): operation stage manipulation API for the scheduler. -
Job.cancel_operation(): operation cancellation call.
-
-
Refactor the Schedulerwith new public interface:-
Scheduler.register_client()andScheduler.unregister_client(): add/remove a job's operation watcher. -
Scheduler.queue_job()andScheduler.retry_job(): job handling API for the execution/operation interface. -
Scheduler.request_job_leases()andScheduler.update_job_lease_state(): update a job's lease state from the bot interface. -
Scheduler.cancel_operation(): operation cancellation for the operation interface.
-
(Cancellation is out of the scope of that issue, see #48 (closed) and #74 (closed))
Edited by Martin Blanchard