Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeregisterMessageParserCallback ¶
func DeregisterMessageParserCallback[T any](r *MessageParsers_Registry, handler *TypedHandler[*T])
Generic function to register parser and callback for type T
if `parser` is nil, the callback will be called upon any non-error unmarshall of messages (not recommended unless it is the only message structure that is received)
Types ¶
type CallbackFunc ¶
type CallbackFunc[T any] func(T)
type MessageParsers_Registry ¶
type MessageParsers_Registry struct {
// contains filtered or unexported fields
}
MessageParsers_Registry to store generic handlers
func (*MessageParsers_Registry) TryDispatch ¶
func (parserRegistry *MessageParsers_Registry) TryDispatch(msg []byte) (callback_called bool)
type TypedHandler ¶
type TypedHandler[T any] struct { // contains filtered or unexported fields }
Concrete handler for type T
func RegisterMessageParserCallback ¶
func RegisterMessageParserCallback[T any](r *MessageParsers_Registry, parser ParserFunc[*T], callback CallbackFunc[*T]) *TypedHandler[*T]
Generic function to register parser and callback for type T
if `parser` is nil, the callback will be called upon any non-error unmarshall of messages (not recommended unless it is the only message structure that is received)
Click to show internal directories.
Click to hide internal directories.