callAll() return value

Mark Taylor m.b.taylor at bristol.ac.uk
Mon Sep 15 10:04:44 PDT 2008


On Mon, 15 Sep 2008, Mike Fitzpatrick wrote:

> It's the Monday morning after an extended trip so maybe I'm
> missing something:  the purpose of returning the msg-id in a
> call() was so that when the recipient sent a reply() with the ID
> the sender would be able to map a reply to the original message.
> Don't we lose that if callAll() doesn't provide the msg-id?
>
> Perhaps a simpler solution is for callAll() to return a map containing
> both the msg-id and the recipient list (and for convenience maybe even
> a count)?  In your scheme I can send two callAll() and perhaps get
> back an OK and and ERR from one recipient, but I won't know which
> of the messages actually failed.

No that's not right.  The msg-tag which the sender generates and passes 
as an argument to callAll() is what's used to match up sends with replies, 
so this confusion does not result.  The msg-id returned from callAll() 
is only used in the comparatively rare case when the sender needs to 
send or interpret progress messages or similar; it is not required 
just for matching up sends with replies.

However, thinking about it a bit more, a tidier solution might be 
for callAll() to return a map in which the keys are client-ids of 
the recipients, and the values are the corresponding msg-ids. 
Then callAll() provides all the same information as multiple call()s.

Mark

-- 
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/



More information about the apps-samp mailing list