Launching a background process

2009-07-27 Thread Dave Forgac

I am trying to write an application that will allow a user to launch a
fairly long-running process (5-30 seconds). It should then allow the
user to check the output of the process as it is generated.  The
output will only be needed for the user's current session so nothing
needs to be stored long-term.  I have two questions regarding how to
accomplish this:

1. What is the best way to launch a background process such as this
with a Pylons controller?

2. What is the best way to get the output of the background process
back to the user?

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Launching a background process

2009-07-27 Thread Dave Forgac

I am trying to write an application that will allow a user to launch a
fairly long-running process (5-30 seconds). It should then allow the
user to check the output of the process as it is generated.  The
output will only be needed for the user's current session so nothing
needs to be stored long-term.  I have two questions regarding how to
accomplish this:

1. What is the best way to launch a background process such as this
with a Pylons controller?

2. What is the best way to get the output of the background process
back to the user?

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Launching a background process

2009-07-27 Thread Graham Dumpleton



On Jul 27, 2:07 pm, Dave Forgac tylerd...@gmail.com wrote:
 I am trying to write an application that will allow a user to launch a
 fairly long-running process (5-30 seconds). It should then allow the
 user to check the output of the process as it is generated.  The
 output will only be needed for the user's current session so nothing
 needs to be stored long-term.  I have two questions regarding how to
 accomplish this:

 1. What is the best way to launch a background process such as this
 with a Pylons controller?

 2. What is the best way to get the output of the background process
 back to the user?

Often the better way of doing this is to run a separate persistent
long running process which has an XML-RPC interface and have the web
application communicate with the back end process using XML-RPC. This
avoids all the mess that can often occur with forking off a web
application process.

The back end might then perform the work by using a thread pool which
consumes the queued up requests. The XML-RPC interface would still be
active and allow for monitoring of state of a queued work item, or
even stopping it if worker thread has a way to be flagged through the
record for the work item.

Graham
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Launching a background process

2009-07-27 Thread Wichert Akkerman

On 7/27/09 8:40 AM, Graham Dumpleton wrote:


 On Jul 27, 2:07 pm, Dave Forgactylerd...@gmail.com  wrote:
 I am trying to write an application that will allow a user to launch a
 fairly long-running process (5-30 seconds). It should then allow the
 user to check the output of the process as it is generated.  The
 output will only be needed for the user's current session so nothing
 needs to be stored long-term.  I have two questions regarding how to
 accomplish this:

 1. What is the best way to launch a background process such as this
 with a Pylons controller?

 2. What is the best way to get the output of the background process
 back to the user?

 Often the better way of doing this is to run a separate persistent
 long running process which has an XML-RPC interface and have the web
 application communicate with the back end process using XML-RPC. This
 avoids all the mess that can often occur with forking off a web
 application process.

zc.async (see http://packages.python.org/zc.async/1.5.0/ ) might also be 
interesting.

Wichert.

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---