[Product-Developers] plone.app.async / collective.cron stabilisation

kiorky kiorky at cryptelium.net
Thu Sep 13 16:41:53 UTC 2012


Hi;

There is a long time, i and David Glick created & used a branch of 
plone.app.async [1]:

The main goals were:

     - Having a better UI
     - The (delayed) retry policy
     - Having the possibility to delay jobs

Problem will be that some similar functionalities was added since, but not in 
the same way, so we have to choose where to go and what to merge.

For example, to defer jobs:

Patrick Gerken choosed my former way that a long time ago did not go for 
mainstream (see defer [2] branch) to add API Methods
The only advantage is not to break API.
But if we want to be complete, we need to add some delaying wrappers to the 
other queuing methods.
It makes the API uglier, that's why with Yiorgis Gozadinos, we didn't choosed to 
merge the 'defer' branch.

David Glick choosed a more elegant way: subclass Job:
This does not break API unless you defer jobs.
- 
https://github.com/plone/plone.app.async/commit/3d9b2c9a7a47eed1d8214c2bb38389b50d32c176
An exemple how to defer job present in the wild [3].

Basicaly, the idea is to instantiate a job on the behalf of the async queue, 
then you set appropriate properties and reschedule it (eg: begin_after).
The only magic is to do it before any commit.
<https://github.com/collective/collective.cron/blob/master/src/collective/cron/adapters/manager.py#L106>

What i want to do: Make david's branch master but cherry picking:
- 
https://github.com/plone/plone.app.async/commit/9b6ba3afedefc824fe0d121d060ea58f45824d78
-https://github.com/plone/plone.app.async/commit/5c903ad39a30eba8ae7b0533b2736b21594e67d5 
(already in the branch)
-https://github.com/plone/plone.app.async/commit/05e9e847b3f75bc821dfde2fa553e392a2dcd5a9 
<https://github.com/plone/plone.app.async/commit/05e9e847b3f75bc821dfde2fa553e392a2dcd5a9>(already 
in the branch)
- 
https://github.com/plone/plone.app.async/commit/b4d571434e969f99141ab9dd08cf0d392a497f1f
- 
https://github.com/plone/plone.app.async/commit/96d7646d8272ba454a598c7990860c0310027dfb
- 
https://github.com/plone/plone.app.async/commit/de1916d8ef9c786792f510319b798d9b654f96f2
- 
https://github.com/plone/plone.app.async/commit/f2854383018b7c39cb36575c0a39826b4e524d22

In:
- 
https://github.com/plone/plone.app.async/commit/2264b999f485e34fe2bf81e5b2b3312ed684d4ee

I would only extract the testcase & write a method "queueJobWithDelay" with the 
same signature but instantiating and scheduling a Job which is the way indicated 
in the branch.
Then, we will have finally something more stable & complete to async stuff with 
plone.


Besides plone.app.async, i would also like to know is there are some users 
(except me) of collective.cron which complete this functionality with recurrent 
jobs...



- 1: https://github.com/plone/plone.app.async/tree/davisagli-ui
- 2: https://github.com/plone/plone.app.async/tree/defer
- 3: 
https://github.com/collective/collective.cron/blob/master/src/collective/cron/adapters/manager.py#L106

-- 
Cordialement,
KiOrKY
GPG Key FingerPrint: 0x1A1194B7681112AF
Pensez à l’environnement.
N’imprimez ce courriel que si vous en avez vraiment besoin.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120913/7f096e40/attachment.html>


More information about the Product-Developers mailing list