queue

package
v0.0.0-...-e23051b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

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

Queue provides a best-effort durability, FIFO interface to the datastore for storing cids

Best-effort durability just means that cids in the process of being provided when a crash or shutdown occurs may be in the queue when the node is brought back online depending on whether the underlying datastore has synchronous or asynchronous writes.

func NewQueue

func NewQueue(ctx context.Context, name string, ds datastore.Datastore) (*Queue, error)

NewQueue creates a queue for cids

func (*Queue) Close

func (q *Queue) Close() error

Close stops the queue

func (*Queue) Dequeue

func (q *Queue) Dequeue() <-chan cid.Cid

Dequeue returns a channel that if listened to will remove entries from the queue

func (*Queue) Enqueue

func (q *Queue) Enqueue(cid cid.Cid) error

Enqueue puts a cid in the queue

Jump to

Keyboard shortcuts

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