queue

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT, Apache-2.0, MIT Imports: 8 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 durable, FIFO interface to the datastore for storing cids

Durability just means that cids in the process of being provided when a crash or shutdown occurs will still be in the queue when the node is brought back online.

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