any chance to capture the startup and shutdown of a Pyramid service?
I want to capture start/stop of Pyramid as event in our central
monitoring service.
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
WSGI is a pure request-level protocol, it does not handle or care how it is
served. As a result, a WSGI app (such as Pyramid) has no concept of when
the service begins or ends. The closest you'll get to this is a startup
hook such as your main() or ApplicationCreated for tracking the start. The
other option is to hope that your server has hooks that can be used to
track this. Finally, process state can be monitored externally via
supervisor or some other process monitor.
On Fri, Jan 25, 2013 at 1:11 AM, Andreas Jung <li...@zopyx.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Hi there,
> any chance to capture the startup and shutdown of a Pyramid service?
> I want to capture start/stop of Pyramid as event in our central
> monitoring service.
> Andreas
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
Michael Merickel wrote:
> WSGI is a pure request-level protocol, it does not handle or care how
> it is served. As a result, a WSGI app (such as Pyramid) has no
> concept of when the service begins or ends.
As Zope veteran, I know :-) I am asking about the backend, not the WSGI
level.
> The closest you'll get to this is a startup hook such as your main()
> or ApplicationCreated for tracking the start.
ACK for the startup
> The other option is to hope that your server has hooks that can be
> used to track this. Finally, process state can be monitored > externally via supervisor or some other process monitor.
I am still missing for the shutdown phase. Supervisord...is an option
but I want to have something in my app. I tried using an atexit handler
but it is never executed.
- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> Michael Merickel wrote:
> > WSGI is a pure request-level protocol, it does not handle or care how
> > it is served. As a result, a WSGI app (such as Pyramid) has no
> > concept of when the service begins or ends.
> As Zope veteran, I know :-) I am asking about the backend, not the WSGI
> level.
> > The closest you'll get to this is a startup hook such as your main()
> > or ApplicationCreated for tracking the start.
> ACK for the startup
> > The other option is to hope that your server has hooks that can be
> > used to track this. Finally, process state can be monitored
> > externally via supervisor or some other process monitor.
> I am still missing for the shutdown phase. Supervisord...is an option
> but I want to have something in my app. I tried using an atexit handler
> but it is never executed.
> - -aj
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.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 pylons-discuss+unsubscribe@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
Problem solved for now. My atexit.register() handler is now called
when I used pserve without --reload option. Using --reload cause
the handler being ignored.
> 2013/1/25 Andreas Jung <li...@zopyx.com <mailto:li...@zopyx.com>>
> Michael Merickel wrote:
>> WSGI is a pure request-level protocol, it does not handle or care
>> how it is served. As a result, a WSGI app (such as Pyramid) has no >> concept of when the service begins or ends.
> As Zope veteran, I know :-) I am asking about the backend, not the
> WSGI level.
>> The closest you'll get to this is a startup hook such as your
>> main() or ApplicationCreated for tracking the start.
> ACK for the startup
>> The other option is to hope that your server has hooks that can be >> used to track this. Finally, process state can be monitored >> externally via supervisor or some other process monitor.
> I am still missing for the shutdown phase. Supervisord...is an
> option but I want to have something in my app. I tried using an
> atexit handler but it is never executed.
> -aj
> -- 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
> pylons-discuss+unsubscribe@googlegroups.com > <mailto:pylons-discuss%2Bunsubscribe@googlegroups.com>. To post to
> this group, send email to pylons-discuss@googlegroups.com > <mailto:pylons-discuss@googlegroups.com>. Visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en. For more
> options, visit https://groups.google.com/groups/opt_out.
> -- 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
> pylons-discuss+unsubscribe@googlegroups.com. To post to this group,
> send email to pylons-discuss@googlegroups.com. Visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en. For more
> options, visit https://groups.google.com/groups/opt_out.