server

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: AGPL-3.0, AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	worker.Worker
	// contains filtered or unexported fields
}

Map holds reference to the database and logger and provides methods to store and retrieve data

func NewMap

func NewMap(fileStore string, log *logging.Logger, gcSize int, mapSize int) (*Map, error)

NewMap instantiates a map

func (*Map) GarbageCollect

func (m *Map) GarbageCollect() error

GarbageCollect prunes the oldest bucket of entries when the map size limit is exceeded

func (*Map) Get

func (m *Map) Get(msgID common.MessageID) ([]byte, error)

Get retrieves an item from the db

func (*Map) OnCommand

func (m *Map) OnCommand(cmd cborplugin.Command) error

func (*Map) Put

func (m *Map) Put(msgID common.MessageID, payload []byte) error

Put places an item in the db

func (*Map) RegisterConsumer

func (m *Map) RegisterConsumer(svr *cborplugin.Server)

func (*Map) Shutdown

func (m *Map) Shutdown()

func (*Map) Wait

func (m *Map) Wait(msgID common.MessageID, response *cborplugin.Response)

Wait adds pending cborplugin.Responses (with SURBs) by MessageID to a waiting map

func (*Map) Wake

func (m *Map) Wake(msgID common.MessageID, payload []byte) error

Wake returns the pending responses from the waiting map and removes the entries

Jump to

Keyboard shortcuts

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