enqueue

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(q *kernel.Enqueuer, cat string) (snd chan<- []byte, dlq <-chan []byte)

Create pair of channels to emit pure binaries

func Event

func Event[M, T any](q *kernel.Enqueuer, category ...string) (snd chan<- swarm.Event[M, T], dlq <-chan swarm.Event[M, T])

Creates pair of channels to emit events of type T

func Typed

func Typed[T any](q *kernel.Enqueuer, category ...string) (snd chan<- T, dlq <-chan T)

Creates pair of channels to emit messages of type T

Types

type EmitterBytes

type EmitterBytes struct {
	// contains filtered or unexported fields
}

Synchronous emitter of raw packets (bytes) to the broker. It blocks the routine until the message is accepted by the broker.

func NewBytes

func NewBytes(q *kernel.Enqueuer, category string) *EmitterBytes

Creates synchronous emitter

func (*EmitterBytes) Enq

func (q *EmitterBytes) Enq(ctx context.Context, object []byte, cat ...string) error

Synchronously enqueue bytes to broker. It guarantees message to be send after return

type EmitterEvent

type EmitterEvent[M, T any] struct {
	// contains filtered or unexported fields
}

Synchronous emitter of events to the broker. It blocks the routine until the event is accepted by the broker.

func NewEvent

func NewEvent[M, T any](q *kernel.Enqueuer, category ...string) *EmitterEvent[M, T]

Creates synchronous event emitter

func (*EmitterEvent[M, T]) Enq

func (q *EmitterEvent[M, T]) Enq(ctx context.Context, object swarm.Event[M, T], cat ...string) error

Synchronously enqueue event to broker. It guarantees event to be send after return.

type EmitterTyped

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

Synchronous emitter of typed messages to the broker. It blocks the routine until the message is accepted by the broker.

func NewTyped

func NewTyped[T any](q *kernel.Enqueuer, category ...string) *EmitterTyped[T]

Creates synchronous typed emitter

func (*EmitterTyped[T]) Enq

func (q *EmitterTyped[T]) Enq(ctx context.Context, object T, cat ...string) error

Synchronously enqueue message to broker. It guarantees message to be send after return

Jump to

Keyboard shortcuts

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