You can also checkout worker threads : 
http://chrismoos.com/2009/03/04/pylons-worker-threads/

On Jun 7, 2:35 pm, Didip Kerabat <[email protected]> wrote:
> There are several things you can do architecture-wise.
>
> Are you able to add system requirement by installing Queue server? The
> following are example of queue servers:
> * RabbitMQ
> * Kestrel
>
> In simple diagram this is what the architecture might look like:
>
> web form ---> serialize form input and the shell command as pickle/json
> -----> put it in as a ticket ----> Queue Server
>
> Then
>
> in separate process, create a long running job consumer (you can use either
> crontab or daemonized worker) that process the ticket popped from the queue
> server.
>
> Queue Server <---- ticket ----> job consumer (that actually perform the
> shell command).
>
> Hope that helps.
>
> - Didip -
>
> PS: If you are unable to add queue server as part of system requirement,
> then you can be creative by using database as a queue.
>
> On Sun, Jun 6, 2010 at 12:50 AM, sharath maddineni <
>
> [email protected]> wrote:
> > How to run the jobs in queue??
> > what do you mean by
> > "write a jobs Queue to process the job   async"???
>
> > Thanks,
> > Sharath
>
> > On Sun, Jun 6, 2010 at 1:09 PM, 佳音张 <[email protected]> wrote:
> > > my be you can throw the job to a works  Queue or a message Queue instead
> > or
> > > write a jobs Queue to process the job   async
> > > 2010/6/6 sharath maddineni <[email protected]>
>
> > >> Hii all,
>
> > >> I am trying to use threading in the controller of pylons application
> > like
> > >> this
>
> > >> class FooController(BaseController):
> > >>    def submitted(self):
> > >>         ...
> > >>         .
> > >>         .
> > >>         stdin, stdout, stderr = popen2.popen3("/bin/app-name
> > input-text")
> > >>         stdout.close()
> > >>         stdin.close()
> > >>         stderr.close()
> > >>         .
> > >>         .
> > >>         return render("/submit.mako")
>
> > >> The input data is a sequence submitted from the text submitted through
> > >> a form. This text is stored in the database.
>
> > >> So, now the controllers opens a thread and runs the application with
> > >> the input text.
>
> > >> There is problem  here the user has to wait till the application
> > >> computes the input text even using a thread.
>
> > >> So, If the app runs for 1 minute the user does not response till 1
> > >> minute after he submits the form.
> > >> can anyone tell me how to remove the delay in response time?
> > >> or suggest a new way to run the app without dela in response time for
> > >> user.....
>
> > >> I even tried this but the problem was the same....
>
> > >> self.job_run_thread=threading.Thread(target=self.job_runner(jq.jobid))
>
> > >> Thanks,
> > >> Sharath
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "pylons-discuss" group.
> > >> To post to this group, send email to [email protected].
> > >> To unsubscribe from this group, send email to
> > >> [email protected]<pylons-discuss%[email protected]>
> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/pylons-discuss?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "pylons-discuss" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<pylons-discuss%[email protected]>
> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/pylons-discuss?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "pylons-discuss" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<pylons-discuss%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/pylons-discuss?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to