Another comment on this.
This PR does not ensure that the classes Job and JobQueue itself can be easily persisted/pickled. This is because
- The
ext.Jobinstance has a reference to theaps.Jobinstance and this cycling reference can be a problem - The
JobQueuehas a reference to the APS Scheduler and a weak reference to theApplicationboth of which are surely not easy to persist
IMO making ext.{Job, JobQueue} pickable out ouf the box is a non-goal of this PR. Serializing a APS Job will still be possible with reasonable effort with the following two considerations:
- the first argument of the APS Job callback will be the
JobQueue. By storing a reference to that in theJobStoreitself, it will be straight forward to re-insert that on deserializing the APS Job - the second argument of the APS Job callback will be the
ext.Job. Instead of serializing that, one can instead serialize the attributes (callback,chat_id, …)