I'm using PostgreSQL's internal NOTIFY/LISTEN semantics in a custom message
queue over a BackgroundJob table. It's been fantastic for not requiring an
external queue and maintaining transactional semantics. Just fire off
request.enqueue_job('mailer', 'send_account_invitation', {'email': '
[email protected]'})
And it's controlled by the ZTE over the same SQLA session as everything
else. The MQ worker actually uses pyramid_mailer in a dummy pyramid app in
order to send emails because I wanted to use pyramid_jinja2 for rendering.
Anyway, all I'm saying is that there's alternatives if you don't need WEB
SCALE. If I had to drop transactional semantics (because the internet told
me using your database as a queue is a bad idea) then I would simply use
transaction.addAfterCommitHook() to perform operations, and they wouldn't
fire off until a successful commit.
On Thu, May 1, 2014 at 10:54 AM, Jonathan Vanasco <[email protected]>wrote:
>
>
> On Thursday, May 1, 2014 12:52:17 AM UTC-4, Michael Merickel wrote:
>>
>> It sounds like you'll be interested in subscriber predicates.
>>
>> http://docs.pylonsproject.org/projects/pyramid/en/1.5-
>> branch/narr/hooks.html#subscriber-predicates
>>
>> Personally I send emails from message queue in a separate process and so
>> there is no conflict between these rendering environments despite both
>> using pyramid apis.
>>
>
> thanks for the predicate tip!
>
> Nightly emails are handled by a separate process. Action-oriented ones
> are handed in-process. Converting those to messaging isn't a bad idea...
> But I already built out `transaction` savepoint support for emails, and
> the pyramid celery integration doesn't have any transaction support yet...
> so I'd probably either have to build that from scratch or use something
> that keeps hitting PostgresSQL as the queue instead of using Redis.
>
>
>
> --
> 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].
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.
>
--
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].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.