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.
