Re: [PATCH] IPC subscriptions mechanism

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 15 Aug 2011 16:02:15 -0600

On 08/13/2011 06:47 AM, Amos Jeffries wrote:
> On 13/08/11 05:23, Amos Jeffries wrote:
>> This adds support for components to register to receive AsyncCalls when
>> IPC messages are received.
>>
>> The subscription is linked to a message type. With currently one
>> registered recipient Job per type.
>>
>
> Updated version. Includes a new file ipc/Messages.cc to define the
> subscriptions registry global.
>
> Now tested and works.

Can you hide Ipc::MessageSubscriptions from subscribers? It seems like
that variable does not need to be globally visible, and there is no need
to inline registration management.

Consider relaxing the RegisterListenFor() check to allow repeated
registrations if callSub has not changed. After all, you do allow
repeated unregistrations.

It may be worth documenting that registration API is for listening to
_all_ messages of a certain type, and is not suitable for catching an
individual response to a specific IPC request. The caller is supposed to
write a second layer mapping/registration routine that will map
individual responses to the code/state waiting for them.

HTH,

Alex.
Received on Mon Aug 15 2011 - 22:02:42 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 16 2011 - 12:00:03 MDT