ContextualMessageHandler
public class ContextualMessageHandler : MessageParserA utility to parse RawMessages and call their attached handlers within a certain context.
This class is similar to PureMessageHandler with the difference that the registered handlers are also passed a certain context in addition to the attached message. This context can be used to determine where the message comes from.
- 
                  
                  Undocumented DeclarationSwift public typealias Context = ConnectionState
- 
                  
                  Attaches a message handler to a concrete Messagetype. Every time a message of this type comes in, the providedhandlerwill be called. The handler takes one generic argumentmessage. The type of this argument indicates the type that this message handler will be attached to.DeclarationSwift public func when<M>(_ handler: @escaping (_ message: M, _ context: Context) -> Void) where M : DeserializableMessageParametershandlerThe handler to attach messageThe message to which the handler is attached contextThe context messagewas sent from.
 View on GitHub
View on GitHub ContextualMessageHandler Class Reference
        ContextualMessageHandler Class Reference