Re: Trying to run jobs in the background using multiprocessing

2013-11-28 Thread Pau Creixell
Cool, thanks Javier. I will look into the different solutions you suggest. Cheers, Pau On Thursday, November 28, 2013 9:32:15 AM UTC+1, Javier Guerra wrote: > > On Thu, Nov 28, 2013 at 2:42 AM, Pau Creixell > > wrote: > > I guess if there isn't another simpler way, I'll

Re: Trying to run jobs in the background using multiprocessing

2013-11-28 Thread Javier Guerra Giraldez
On Thu, Nov 28, 2013 at 2:42 AM, Pau Creixell wrote: > I guess if there isn't another simpler way, I'll have to dig into Celery. there _are_ simpler alternatives to Celery: - worker threads: similar to your proposal, but with very well-thought process control. pros: no

Re: Trying to run jobs in the background using multiprocessing

2013-11-27 Thread Pau Creixell
Hi again, Thanks for all your answers. Yes, I also found out many recommend Celery, but I was hoping for a "simpler" solution, if there is one... Doug, I already tried without the self in arguments, but got the same error, unfortunately. I guess if there isn't another simpler way, I'll have to

Re: Trying to run jobs in the background using multiprocessing

2013-11-27 Thread Doug Blank
On Wed, Nov 27, 2013 at 2:58 PM, Pau Creixell wrote: > Hi there! > > I am trying to run jobs in the background using the following (minimal) > code: > > Under views.py: > > def submit(request): >model = MyModel() >model.RunInAThread(ReferenceSeparator,

Re: Trying to run jobs in the background using multiprocessing

2013-11-27 Thread Avraham Serour
maybe your webserver won't permit multiprocessing, it depends on how you are running django. In any case I would also recommend celery, in this case you have control on how many workers are running, having a webrequest open yet another process means you won't have control on how many processes

Re: Trying to run jobs in the background using multiprocessing

2013-11-27 Thread Timothy W. Cook
When I asked about this it seems that the best solution is to use Celery in combination with Django. There seems to be quite a bit of good experience here using them together. HTH, Tim On Wed, Nov 27, 2013 at 5:58 PM, Pau Creixell wrote: > Hi there! > > I am trying to

Trying to run jobs in the background using multiprocessing

2013-11-27 Thread Pau Creixell
Hi there! I am trying to run jobs in the background using the following (minimal) code: Under views.py: def submit(request): model = MyModel() model.RunInAThread(ReferenceSeparator, MutationSeparator) Under models.py: class MyModel(models.Model): def RunInAThread(self,