Apps Messaging - Semantics of a Message
Mark Taylor
m.b.taylor at bristol.ac.uk
Tue Apr 10 03:21:17 PDT 2007
On Sat, 7 Apr 2007, John Taylor wrote:
> Do any of the Plastic devs have any comments about which style of messaging
> they use? I tend to use synchronous messaging when the reply is important,
> but responsiveness isn't (e.g. the metadata gathering case above), and
> asynchronous when the reply is unimportant but you want to be responsive (
> e.g. sending a row subset for an application to highlight).
>From Java, I'd be happy to use asynchronous messaging at all times;
it's not all that arduous to build synchronous functionality on top
of asynchronous primitives, and if you're using a library this
kind of utility function can be provided. Your example:
> behaviour could be allowed. The sort of use case I have in mind for it is
> that when an application starts up it might want to message all the other
> apps to gather metadata about them (names, descriptions, icons etc) with
> which it will populate one of its menus. If I can send a message
> synchronously it's much easier to code, and it doesn't really matter if one
> of the receiving apps "times out", it will just delay the start up of ours a
> little.
is a good one: if synchronicity is built into the protocol then timeouts
would have to be quite long for the case in which the request is an
expensive one (load or analyse a large image), and I don't want to delay
application startup by that kind of timescale (or, indeed, even by a
few seconds) in the presence of poorly-behaved applications.
So, on the whole, I am in favour of all-asynchronous messaging.
I think the only compelling argument against is for use from environments
which would have serious difficulties in processing asynchronous messages,
i.e. ones which are not multi-threaded and/or only wish to send and
not to receive messages. These are not something I've given much
thought to - does anybody have use cases for such situations where
a reply is required?
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
mailing list