blocker

package
v0.0.0-...-c7e0420 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker

type Blocker[T any] struct {
	// contains filtered or unexported fields
}

func NewBlocker

func NewBlocker[T any](blockerAttr *BlockerAttr) *Blocker[T]

func (*Blocker[T]) Capacity

func (b *Blocker[T]) Capacity() uint32

func (*Blocker[T]) ChannelName

func (b *Blocker[T]) ChannelName() string

func (*Blocker[T]) ClearObserved

func (b *Blocker[T]) ClearObserved()

func (*Blocker[T]) ClearPublished

func (b *Blocker[T]) ClearPublished()

func (*Blocker[T]) GetLatestObserved

func (b *Blocker[T]) GetLatestObserved() T

func (*Blocker[T]) GetLatestPublished

func (b *Blocker[T]) GetLatestPublished() T

func (*Blocker[T]) GetOldestObserved

func (b *Blocker[T]) GetOldestObserved() T

func (*Blocker[T]) IsObservedEmpty

func (b *Blocker[T]) IsObservedEmpty() bool

func (*Blocker[T]) IsPublishedEmpty

func (b *Blocker[T]) IsPublishedEmpty() bool

func (*Blocker[T]) Observe

func (b *Blocker[T]) Observe()

func (*Blocker[T]) Publish

func (b *Blocker[T]) Publish(msg T)

func (*Blocker[T]) SetCapacity

func (b *Blocker[T]) SetCapacity(cap uint32)

func (*Blocker[T]) Subscribe

func (b *Blocker[T]) Subscribe(callbackID string, callback Callback[T]) bool

func (*Blocker[T]) Unsubscribe

func (b *Blocker[T]) Unsubscribe(callbackID string) bool

type BlockerAttr

type BlockerAttr struct {
	Capacity    uint32
	ChannelName string
}

type Callback

type Callback[T any] func(T)

Jump to

Keyboard shortcuts

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