Hi all,
I'm persisting in my one man suicide mission to asynchronously start
processes and manage them in an ad-hoc manner in STAX without using
<process /> / <process-action /> and am looking to be able to use NOTIFY
ONEND to get access to the returned stdout & err and whatnot once the
process completes.
I've got some simplified test XML here like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">
<stax>
<defaultcall function="HelloMain">
</defaultcall>
<function name="HelloMain" scope="local" >
<function-no-args/>
<sequence>
<script>
machine = 'local'
request = 'START COMMAND java STDERRTOSTDOUT RETURNSTDOUT
NOTIFY ONEND'
</script>
<stafcmd>
<location>machine</location>
<service>'PROCESS'</service>
<request>request</request>
</stafcmd>
<script>
# wait a while to ensure completion
import time
time.sleep(5)
</script>
<script>
request = 'QUERY HANDLE %s' % (STAFResult)
</script>
<stafcmd >
<location>machine</location>
<service>'PROCESS'</service>
<request>request</request>
</stafcmd>
<log level="'info'">'The query result: %s' % (STAFResult)</log>
<stafcmd>
<location>machine</location>
<service>'QUEUE'</service>
<request>'PEEK ALL'</request>
</stafcmd>
<log level="'info'">'Peek response RC=%s STAFResult=%s' % (RC,
STAFResult) </log>
</sequence>
</function>
</stax>
.... although this doesn't seem to be doing what I want. The RC from the
peek is always 29, indicating nothing in the queue. I *think* what I am
trying to do should be possible because yesterday I (largely by
accident) somehow managed to produce an entry in my user log like:
Peek response RC=0 STAFResult=[{'machine':
'tcp://beatrice.prismtech....@6500', 'user': 'none://anonymous',
'handle': '1', 'staf-map-class-name': 'STAF/Service/Queue/Entry',
'timestamp': '20100923-13:32:04', 'type': 'STAF/Process/End',
'priority': '5', 'handleName': 'STAF_Process', 'message':
{'endTimestamp': '20100923-13:32:04', 'fileList': [{'rc': '0', 'data':
''}], 'key': '1', 'rc': '1', 'handle': '21'}}
... with similar QUEUE PEEK debug code after an async started event had
completed.
Can anyone spot what I'm doing wrong here please ?
Cheers,
--
Simon McQueen
e-mail: mailto:[email protected]
Tele: +44-191-497-9966
Web: http://www.prismtech.com
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users