Hi,
Maybe you should have a look at the "DataManager" component interface
provided by the "transaction" package.
This kind of component allows you to include your hook in a "two-phase
commit" transaction safely.
Several implementations are available, for example in the "repoze.sendmail"
package...

Best regards,
Thierry

Le ven. 1 juin 2018 à 05:48, <[email protected]> a écrit :

> Poking around the documentation some more, it seems that using an
> after-commit-hook
> <http://zodb.readthedocs.io/en/latest/transactions.html#after-commit-hooks>
> may work: i.e. when a task needs to be scheduled by the view function, then
> find the request’s transaction (from `request.tm`?) and install the hook
> function and and its arguments (i.e. which task needs to be scheduled and
> the task’s args).
>
> But still, what is the official and recommended way of solving this? 🤔
>
> Cheers!
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/25d30da3-5079-46f7-b15a-2ffe3d44c06e%40googlegroups.com
> <https://groups.google.com/d/msgid/pylons-discuss/25d30da3-5079-46f7-b15a-2ffe3d44c06e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
http://www.imagesdusport.com -- http://www.ztfy.org

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAPX_VWAKO1FD-0crdtJxvJveP0v8ag%3D%2BGs3A7pdY4tjez4s6rA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to