blockcutter

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver struct {
	// IsolatedTx causes Ordered returns [][]{curBatch, []{newTx}}, false when set to true
	IsolatedTx bool

	// CutAncestors causes Ordered returns [][]{curBatch}, true when set to true
	CutAncestors bool

	// CutNext causes Ordered returns [][]{append(curBatch, newTx)}, false when set to true
	CutNext bool

	// SkipAppendCurBatch causes Ordered to skip appending to curBatch
	SkipAppendCurBatch bool

	// Block is a channel which is read from before returning from Ordered, it is useful for synchronization
	// If you do not wish synchronization for whatever reason, simply close the channel
	Block chan struct{}
	// contains filtered or unexported fields
}

Receiver mocks the blockcutter.Receiver interface

func NewReceiver

func NewReceiver() *Receiver

NewReceiver returns the mock blockcutter.Receiver implementation

func (*Receiver) CurBatch

func (mbc *Receiver) CurBatch() []*cb.Envelope

func (*Receiver) Cut

func (mbc *Receiver) Cut() []*cb.Envelope

Cut terminates the current batch, returning it

func (*Receiver) Ordered

func (mbc *Receiver) Ordered(env *cb.Envelope) ([][]*cb.Envelope, bool)

Ordered will add or cut the batch according to the state of Receiver, it blocks reading from Block on return

Jump to

Keyboard shortcuts

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