queue

package
v0.0.0-...-0e8a67c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package queue implements a single-reader, multi-writer distributed queue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvanceEpochFunc

type AdvanceEpochFunc func(ctx context.Context, txn transaction.Txn) error

AdvanceEpochFunc is a function that advances the epoch.

type ProcessKeyValueFunc

type ProcessKeyValueFunc func(ctx context.Context, txn transaction.Txn, key, value []byte) error

ProcessKeyValueFunc is a function that processes a mutation.

type Queuer

type Queuer interface {
	// Enqueue submits a key, value pair for processing.
	// Duplicate key, value pairs will be processed in the order received by
	// the queue. Mutations SHOULD explicitly reference any data they modify
	// to be robust across epoch updates.
	Enqueue(key, value []byte) error

	// Commit all enqueued items to the sparse merkle tree.
	AdvanceEpoch() error

	// StartReceiving starts receiving queue enqueued items.
	StartReceiving(processFunc ProcessKeyValueFunc, advanceFunc AdvanceEpochFunc) (Receiver, error)
}

Queuer submits new mutations to be processed.

type Receiver

type Receiver interface {
	// Close stops the receiver from receiving items from the queue.
	Close()
}

Receiver represents a queue receiver.

Jump to

Keyboard shortcuts

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