Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMiddleware ¶
func NewMiddleware() func(eh.EventHandler) eh.EventHandler
NewMiddleware creates a new middleware that can be examined for ephemeral status. A handler can be ephemeral if it never cares about events created before the handler, or care about events that might occur when the handler is offline.
Such handlers can be for instance handlers that create their initial state on startup but needs to update their internal state based on events as they happen.
Marking a handler as ephemeral enables event publishers to optimize operations and clean up subscriptions when they are no longer needed.
Types ¶
type EphemeralHandler ¶
type EphemeralHandler interface {
IsEphemeralHandler() bool
}
EphemeralHandler is used to check for an ephemeral observer middleware in a chain.
Click to show internal directories.
Click to hide internal directories.