inbox

package
v0.0.0-...-1c5f5a9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDLE int32 = iota
	RUNNING
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Msg any
}

type Inbox

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

func NewInbox

func NewInbox[T constraints.Signed](size T) *Inbox

func (*Inbox) Push

func (slf *Inbox) Push(env Envelope)

func (*Inbox) Start

func (slf *Inbox) Start(processor Processor)

func (*Inbox) Stop

func (slf *Inbox) Stop() error

type Processor

type Processor interface {
	Invoke(envelopes []Envelope)
}

type Scheduler

type Scheduler interface {
	Schedule(fn func())
	Throughput() int
}

func NewScheduler

func NewScheduler(throughput int) Scheduler

Jump to

Keyboard shortcuts

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