COCPORN / succubus

An event library.
MIT License
6 stars 1 forks source link

Move code to determine message calls from transport to bus #12

Open COCPORN opened 10 years ago

COCPORN commented 10 years ago

This code:

var synchronousFrame = coreMessage as Core.MessageFrames.Synchronous;
var eventFrame = coreMessage as Core.MessageFrames.Event;
if (synchronousFrame != null)
{
    Bridge.ProcessSynchronousMessages(synchronousFrame, address);
    Bridge.ProcessCatchAllEvents(synchronousFrame, address);
    if (ReportRaw)
    {
        Bridge.RawMessage(synchronousFrame);
    }
}
else if (eventFrame != null)
{
    Bridge.ProcessEvents(eventFrame, address);
    if (ReportRaw)
    {
        Bridge.RawMessage(eventFrame);
    }
}

...seems to be a pattern in many transports, and this should be moved to the bus. This will also simplify the ITransportBridge-interface.