I think that this is rather a big chunk of logic to be buried in the middle of MirSocketRpcChannel::read_message() - I'd be happier to see a separate handle_event() member function. (I'm still not totally convinced that MirSocketRpcChannel is the right place for this logic but PendingCallCache doesn't seem any better - although a rename might fix that.)
Actually, if we're going to stick event handling into the "wire" decoding logic I'd rather be changing wire::Result to have an optional event field instead of have a special value in the id field and reusing the response field.
612 + if (event_handler)
613 + {
...
647 + } // else ignore incoming events
I think that this is rather a big chunk of logic to be buried in the middle of MirSocketRpcCha nnel::read_ message( ) - I'd be happier to see a separate handle_event() member function. (I'm still not totally convinced that MirSocketRpcChannel is the right place for this logic but PendingCallCache doesn't seem any better - although a rename might fix that.)
Actually, if we're going to stick event handling into the "wire" decoding logic I'd rather be changing wire::Result to have an optional event field instead of have a special value in the id field and reusing the response field.