Marco Mornati wrote:
I know what you say and I also know that ls command wasn't a good
example :)
Anyway, where we are using async call is inside OpenSymbolic, and we
have planned to use always async call because inside code we don't
know if a specific command is a "long run" or not.
As I read inside async documentation (on this ML to be exactly) the
difference using nopoll is when the results are shown. if I want to
"wait" for a result I don't need nopoll attribute (that will be
printed when certmaster receive the anwer), else I need the "nopoll"
but, as I seen there's no way to retreive the output string.
As you know we have code symbolic using groovy (java) so it's a bit
difficult to call func using a python API (but I know it's the better
way).
I think for us, the better way to make a func call is using the
XML-RPC (wip, I know) but I wanted to try to make this test using
async call... Result: FAILED :S
I'll try inside our code without nopoll... but I don't exactly know
what could happen... I'll report the results to you...
If you have any other ideas on async let me know
Thanks a lot Michael
Ah, didn't see the "byte-code" in the subject line. It's all good.
I'll test this and see if I understand where you are coming from.
Yes, having XMLRPC in is going to be nice.
As an aside, for common operations, like "directory contents", it would
be best to write a func minion module for those, so you could get back
structured data, as opposed to just parsing system commands. Combined
with the json output format, that might not even be that bad to parse,
but yes, we want the XMLRPC version or at least the func-transmit idea
that Adrian was talking about.
How is the XMLRPC stuff going? Is there a git branch somewhere we can
look at and possibly offer some help with?
I think func-transmit /might/ be a better approach for cross-language
connections if we are going to rely on permissions (i.e. Unix socket
and/or ACLs), simply because the XMLRPC bindings for other languages may
be hard to coerce to travel over a unix socket. For Python, we have
examples on how to do that, for other languages with XMLRPC bindings,
I'm not so sure it's that trivial.
Perhaps you would like to implement something like func-transmit instead?
--Michael
Bye
Marco
Michael DeHaan wrote:
Marco Mornati wrote:
Hi all,
I'm testing new features included in func/certmaster 0.20 rpm.
I don't understand (I've read the previous post on ML) if it's
possible after an async call, to retrieve the complete output of the
command.
I try with this simple command:
[root@bcmmornati noarch]# func "*" call --async --nopoll command run
"ls /tmp"
JOB_ID: '1214907784.1717141'
Leave off "--nopoll" and it will poll and provide that info. That
being said, there is no reason a short operation like "ls" needs to
be invoked async.
Async is provided for long-running operations, and soon func will be
able to decide what should be invoked with async/poll automatically.
[root@bcmmornati noarch]# func '*' call --jobstatus 1214907784.1717141
The above should provide it if you are using --nopoll. Are you
seeing different?
All work correctly, as you can see, but How I can read the list of
the file inside my TMP folder? I know that is not an usual command,
but could be some test cases where I need to read some output
strings and not only the result of run command...
Read some output strings? If you are scripting this, you should
probably be using the Python API. We're looking at ways to make
this accessible to non-Python apps presently, though parsing the Func
command line is a bit fragile and is not recommended.
But... it's a great feature!! Good job!
Bye
Marco
_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list