slotset

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorClosed = errors.New("SlotSet closed")
)

Functions

This section is empty.

Types

type IterateCallback

type IterateCallback func(slot *Slot) (bool, error)

type Slot

type Slot struct {
	Data interface{}
	// contains filtered or unexported fields
}

func (*Slot) Activate

func (s *Slot) Activate()

func (*Slot) Deactivate

func (s *Slot) Deactivate()

func (*Slot) GetID

func (s *Slot) GetID() int

func (*Slot) Post

func (s *Slot) Post(err error)

func (*Slot) PostWithoutLock

func (s *Slot) PostWithoutLock(err error)

func (*Slot) WaitCtx

func (s *Slot) WaitCtx(ctx context.Context) (bool, error)

func (*Slot) WaitGetChan

func (s *Slot) WaitGetChan() <-chan (error)

type SlotSet

type SlotSet struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New(numSlots int, initCb func(*Slot)) *SlotSet

func (*SlotSet) Close

func (s *SlotSet) Close() error

func (*SlotSet) Get

func (s *SlotSet) Get(ctx context.Context) (*Slot, error)

func (*SlotSet) IterateActive

func (s *SlotSet) IterateActive(cb IterateCallback) error

func (*SlotSet) Put

func (s *SlotSet) Put(slot *Slot)

Jump to

Keyboard shortcuts

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