Hi Friends, We are considering Flask for one of our next mid-sized project, seems Flask provide built-in/extension support for most of our project requirements, one exception though :- Is there a possibility to run a background job from Flask (to be specific, we just want to send a confirmation mail upon successful sign-up and want this to be done in background.) Cheers Soj
Flask-Celery? On Sat, Sep 24, 2011 at 2:29 PM, Sojin <sojin.v@gmail.com> wrote: > Hi Friends, > > We are considering Flask for one of our next mid-sized project, seems Flask > provide built-in/extension support for most of our project requirements, one > exception though :- > Is there a possibility to run a background job from Flask (to be specific, > we just want to send a confirmation mail upon successful sign-up and want > this to be done in background.) > > Cheers > Soj >
Celery could be an option but if you want a KISS approach I suggest to use Flask-Script [*] and cron. Alex [*] http://packages.python.org/Flask-Script/ On Sat, Sep 24, 2011 at 12:35 PM, Alex K <lestatcheb@googlemail.com> wrote: > Flask-Celery? > > On Sat, Sep 24, 2011 at 2:29 PM, Sojin <sojin.v@gmail.com> wrote: >> >> Hi Friends, >> >> We are considering Flask for one of our next mid-sized project, seems >> Flask provide built-in/extension support for most of our project >> requirements, one exception though :- >> Is there a possibility to run a background job from Flask (to be specific, >> we just want to send a confirmation mail upon successful sign-up and want >> this to be done in background.) >> >> Cheers >> Soj > >
Hi, On 2011-09-24 3:37 PM, Alex wrote: > Celery could be an option but if you want a KISS approach I suggest to > use Flask-Script [*] and cron. Why not redis? Redis is amazing for this. Regards, Armin
Hi, To add to the "Why not redis" remark. Here a dead simple way to use redis as a queue with Python: http://flask.pocoo.org/snippets/73/ Regards, Armin
Redis/Beanstalkd will work great as task queues. However, if you'll have to implement additional job queue logic on top of them (i.e. to what to do when a job fails, when the system crashes etc.). On the bright side, celery can use Redis/Beanstalkd as its task queue, so you don't have to mess with heavy weight solutions like RabbitMQ or the likes. On Sat, Sep 24, 2011 at 12:50 PM, Armin Ronacher < armin.ronacher@active-4.com> wrote: > Hi, > > To add to the "Why not redis" remark. Here a dead simple way to use > redis as a queue with Python: > > http://flask.pocoo.org/snippets/73/ > > > Regards, > Armin >
But, Flask-Celery can not use Application Factories, how to solve it? 2011/9/25 Cheng-Han Lee <lee.chenghan@gmail.com> > Redis/Beanstalkd will work great as task queues. However, if you'll have to > implement additional job queue logic on top of them (i.e. to what to do when > a job fails, when the system crashes etc.). > > On the bright side, celery can use Redis/Beanstalkd as its task queue, so > you don't have to mess with heavy weight solutions like RabbitMQ or the > likes. > > > On Sat, Sep 24, 2011 at 12:50 PM, Armin Ronacher < > armin.ronacher@active-4.com> wrote: > >> Hi, >> >> To add to the "Why not redis" remark. Here a dead simple way to use >> redis as a queue with Python: >> >> http://flask.pocoo.org/snippets/73/ >> >> >> Regards, >> Armin >> > >
Wow, after recently migrating from Celery/RabbitMQ to Beanstalkd (and * loving* its relative simplicity), I just read over the latest Redis snippet<http://flask.pocoo.org/snippets/73/> and it's also quite attractive. It looks like a very decent middle ground, being both simple to set up and quite natural to use in Python. Redis also seems pretty lightweight. Not as much as Beanstalkd, but looks like it's worth the tradeoff. Thanks for sharing, I'll be playing with Redis today. Also, there's a Redis Windows port on GitHub <http://github.com/dmajkic/redis> for those looking for one. On Sat, Sep 24, 2011 at 8:13 PM, heww0205 <heww0205@gmail.com> wrote: > But, Flask-Celery can not use Application Factories, how to solve it? > > > 2011/9/25 Cheng-Han Lee <lee.chenghan@gmail.com> > >> Redis/Beanstalkd will work great as task queues. However, if you'll have >> to implement additional job queue logic on top of them (i.e. to what to do >> when a job fails, when the system crashes etc.). >> >> On the bright side, celery can use Redis/Beanstalkd as its task queue, so >> you don't have to mess with heavy weight solutions like RabbitMQ or the >> likes. >> >> >> On Sat, Sep 24, 2011 at 12:50 PM, Armin Ronacher < >> armin.ronacher@active-4.com> wrote: >> >>> Hi, >>> >>> To add to the "Why not redis" remark. Here a dead simple way to use >>> redis as a queue with Python: >>> >>> http://flask.pocoo.org/snippets/73/ >>> >>> >>> Regards, >>> Armin >>> >> >> >
Redis is awesome. And the Basic Message Queue with Redis snippet<http://flask.pocoo.org/snippets/73/>is very helpful. There's a bug though. This line: del session[key] should be: del session['add_result_key'] And it works perfectly. On Sun, Sep 25, 2011 at 3:03 PM, Joe Esposito <espo58@gmail.com> wrote: > Wow, after recently migrating from Celery/RabbitMQ to Beanstalkd (and * > loving* its relative simplicity), I just read over the latest Redis > snippet <http://flask.pocoo.org/snippets/73/> and it's also quite > attractive. It looks like a very decent middle ground, being both simple to > set up and quite natural to use in Python. Redis also seems pretty > lightweight. Not as much as Beanstalkd, but looks like it's worth the > tradeoff. > > Thanks for sharing, I'll be playing with Redis today. Also, there's a Redis > Windows port on GitHub <http://github.com/dmajkic/redis> for those looking > for one. > > On Sat, Sep 24, 2011 at 8:13 PM, heww0205 <heww0205@gmail.com> wrote: > >> But, Flask-Celery can not use Application Factories, how to solve it? >> >> >> 2011/9/25 Cheng-Han Lee <lee.chenghan@gmail.com> >> >>> Redis/Beanstalkd will work great as task queues. However, if you'll have >>> to implement additional job queue logic on top of them (i.e. to what to do >>> when a job fails, when the system crashes etc.). >>> >>> On the bright side, celery can use Redis/Beanstalkd as its task queue, >>> so you don't have to mess with heavy weight solutions like RabbitMQ or the >>> likes. >>> >>> >>> On Sat, Sep 24, 2011 at 12:50 PM, Armin Ronacher < >>> armin.ronacher@active-4.com> wrote: >>> >>>> Hi, >>>> >>>> To add to the "Why not redis" remark. Here a dead simple way to use >>>> redis as a queue with Python: >>>> >>>> http://flask.pocoo.org/snippets/73/ >>>> >>>> >>>> Regards, >>>> Armin >>>> >>> >>> >> >
Thanks for options. On Mon, Sep 26, 2011 at 11:47 AM, Joe Esposito <espo58@gmail.com> wrote: > Redis is awesome. > > And the Basic Message Queue with Redis snippet<http://flask.pocoo.org/snippets/73/>is very helpful. > There's a bug though. This line: > > del session[key] > > > should be: > > del session['add_result_key'] > > > And it works perfectly. > > On Sun, Sep 25, 2011 at 3:03 PM, Joe Esposito <espo58@gmail.com> wrote: > >> Wow, after recently migrating from Celery/RabbitMQ to Beanstalkd (and * >> loving* its relative simplicity), I just read over the latest Redis >> snippet <http://flask.pocoo.org/snippets/73/> and it's also quite >> attractive. It looks like a very decent middle ground, being both simple to >> set up and quite natural to use in Python. Redis also seems pretty >> lightweight. Not as much as Beanstalkd, but looks like it's worth the >> tradeoff. >> >> Thanks for sharing, I'll be playing with Redis today. Also, there's a >> Redis Windows port on GitHub <http://github.com/dmajkic/redis> for those >> looking for one. >> >> On Sat, Sep 24, 2011 at 8:13 PM, heww0205 <heww0205@gmail.com> wrote: >> >>> But, Flask-Celery can not use Application Factories, how to solve it? >>> >>> >>> 2011/9/25 Cheng-Han Lee <lee.chenghan@gmail.com> >>> >>>> Redis/Beanstalkd will work great as task queues. However, if you'll have >>>> to implement additional job queue logic on top of them (i.e. to what to do >>>> when a job fails, when the system crashes etc.). >>>> >>>> On the bright side, celery can use Redis/Beanstalkd as its task queue, >>>> so you don't have to mess with heavy weight solutions like RabbitMQ or the >>>> likes. >>>> >>>> >>>> On Sat, Sep 24, 2011 at 12:50 PM, Armin Ronacher < >>>> armin.ronacher@active-4.com> wrote: >>>> >>>>> Hi, >>>>> >>>>> To add to the "Why not redis" remark. Here a dead simple way to use >>>>> redis as a queue with Python: >>>>> >>>>> http://flask.pocoo.org/snippets/73/ >>>>> >>>>> >>>>> Regards, >>>>> Armin >>>>> >>>> >>>> >>> >> >
+1 for redis .
Beanstalkd (and beanstalkc for Python) is another super-simple solution I've
come across.
On Sat, Sep 24, 2011 at 10:58 AM, kracekumar ramaraju <
kracethekingmaker@gmail.com> wrote:
> +1 for redis .
+1 for redis and pyres: https://github.com/binarydud/pyres