ephemeral

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL