execute-processor problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

execute-processor problem

Rodrigo Ojeda
Hi group:

I need to know how to execute a command in background mode. Now my
command left the browser in loading state until the command ends. Is
there a way to execute it with an '&'? on background? I tested with
nohup in a sh script but it didn't work.

Thanks in advance.
Regards!


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: execute-processor problem

Alessandro Vernet
Administrator
Rodrigo,

On Jan 16, 2008 3:38 PM, Rodrigo Ojeda <[hidden email]> wrote:
> I need to know how to execute a command in background mode. Now my
> command left the browser in loading state until the command ends. Is
> there a way to execute it with an '&'? on background? I tested with
> nohup in a sh script but it didn't work.

Good question. This is unfortunately a bit more complex that you could
hope. To run another XPL in another thread (so you are not blocked),
use the scheduler, as follows:

    <p:processor name="oxf:scheduler">
        <p:input name="config">
            <config>
                <start-task>
                    <name>process-job</name>
                    <start-time>now</start-time>
                    <interval>0</interval>
                    <processor-name>oxf:pipeline</processor-name>
                    <input name="config" url="oxf:/path/to/pipeline.xpl"/>
                </start-task>
            </config>
        </p:input>
    </p:processor>

So far so good. But it becomes more complex if you want to pass
arguments to that XPL. The schedule doesn't let you pass arguments, so
you will have to store those arguments somewhere. For instance by
creating a "queue" of jobs to be performed in the application context,
or stored somewhere in your database. I hope this helps,

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: execute-processor problem

Rodrigo Ojeda
Alessandro Vernet wrote:
Rodrigo,

On Jan 16, 2008 3:38 PM, Rodrigo Ojeda [hidden email] wrote:
  
I need to know how to execute a command in background mode. Now my
command left the browser in loading state until the command ends. Is
there a way to execute it with an '&'? on background? I tested with
nohup in a sh script but it didn't work.
    

Good question. This is unfortunately a bit more complex that you could
hope. To run another XPL in another thread (so you are not blocked),
use the scheduler, as follows:

    <p:processor name="oxf:scheduler">
        <p:input name="config">
            <config>
                <start-task>
                    <name>process-job</name>
                    <start-time>now</start-time>
                    <interval>0</interval>
                    <processor-name>oxf:pipeline</processor-name>
                    <input name="config" url="oxf:/path/to/pipeline.xpl"/>
                </start-task>
            </config>
        </p:input>
    </p:processor>

So far so good. But it becomes more complex if you want to pass
arguments to that XPL. The schedule doesn't let you pass arguments, so
you will have to store those arguments somewhere. For instance by
creating a "queue" of jobs to be performed in the application context,
or stored somewhere in your database. I hope this helps,

Alex
  
Thanks Alex.

Regards!


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws