Tk Library Source Code

View Ticket
Login
Ticket UUID: 731457
Title: results are lost for send -async calls
Type: RFE Version: None
Submitter: hemanglavana Created on: 2003-05-02 16:55:32
Subsystem: comm Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-05-11 06:48:30
Resolution: Closed By: hobbs
    Closed on: 2003-05-10 23:48:30
Description:
The documentation suggests that the results of RPC and
remote errors are lost when -async option is specified
 with comm::comm send.

Is there an API which will allow me to wait and/or
retrieve those values of an async invocation? If not,
would it be possible to add such an API to this
package. It would make it really useful to be able to
submit async cmds to more than 1 interps and then wait
for the results at a later point.

-----------------------------------------------------------------

Hm. This requires a number of changes in comm I
believe. If I remember my look at the code correctly
The sender tells the remote side if he is interested in
the results of the call, and if not (i.e. -async) the
remote side does not even make an effort to send this
data back.

... so the sender has to pretend 'no async' to the
remote side, but claim async for itself.

Is there truly a need to wait for the result on your
own ? How about allowing the specification of a
'result' callback instead. Automatically called when
the results return.

The problem I have with waiting later is that comm does
some fairly tricky things with 'vwait' to ensure that
the sender is able to process incoming requests etc.
even while waiting for the result of a synchronous
[send], and this part is not completely understood by
me (yet). Adding callbacks OTOH hand seems simpler to
me. It would also fit into the general model of Tcl for
such a situation.

Andreas

----------------------------------------------------------------------

I would think that the API would be something like
-asyncvar foo, and foo gets set with the data (probably
a list of completion code and result) when completed. 
Perhaps -variable instead, understood to be async, not
to overdo the -async name.

Jeff
----------------------------------------------------------------------
User Comments: hobbs added on 2003-05-11 06:48:30:
Logged In: YES 
user_id=72656

This has been added to tcllib post-1.4 as comm v4.1 with the -
command callback option.