Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventSource ¶
EventSource is a pubsub.Topic that also stores the last published value in an atomic.Value.
Updating the value will result in a publish event.
func New ¶
func New[T any]() *EventSource[T]
func (*EventSource[T]) CompareAndSwap ¶
func (e *EventSource[T]) CompareAndSwap(old, new T) bool
func (*EventSource[T]) Load ¶
func (e *EventSource[T]) Load() T
func (*EventSource[T]) Store ¶
func (e *EventSource[T]) Store(value T)
func (*EventSource[T]) Swap ¶
func (e *EventSource[T]) Swap(value T) T
Click to show internal directories.
Click to hide internal directories.