Processes / Starting Stoping

9 views
Skip to first unread message

pkraus

unread,
Nov 5, 2011, 11:51:56 PM11/5/11
to turbo...@googlegroups.com
I have a web application (warehouse management software) that uses beanstalkd to off load some background processing to keep the site "snappy". Where/how is the best place to add the startup of the process that watches the queue to the turbogears startup? Is there something already in the framework for handling these kinds of situations (secondary python programs that "do stuff" that are integral to the main application) to make sure the process is always running.

Sean DiZazzo

unread,
Nov 7, 2011, 2:36:07 PM11/7/11
to TurboGears
I use supervisor (http://supervisord.org/) to start/stop my Turbogears
apps as well as any daemons. You just need to make sure beanstalkd
doesn't fork. It is a very nice setup with lots of possibilities.

~Sean

Michael Pedersen

unread,
Nov 17, 2011, 3:31:37 PM11/17/11
to turbo...@googlegroups.com
If you *must* have TG start/stop the application, you're probably going to want to look in the myapp.config.middleware module. Personally, I would use an external option, such as supervisord, but you *can* add such things to the middleware to start/stop.


--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.


Alessandro Molina

unread,
Nov 17, 2011, 5:17:19 PM11/17/11
to turbo...@googlegroups.com
On Thu, Nov 17, 2011 at 9:31 PM, Michael Pedersen <m.ped...@icelus.org> wrote:
> If you *must* have TG start/stop the application, you're probably going to
> want to look in the myapp.config.middleware module. Personally, I would use
> an external option, such as supervisord, but you *can* add such things to
> the middleware to start/stop.

You can even consider adding the start/stop instructions to
app_config.call_on_startup and app_config.call_on_shutdown The
functions available in those lists will be called each time the
application starts and stops.

Reply all
Reply to author
Forward
0 new messages