blockcutter

package
v0.0.0-...-c410d66 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver interface {
	// Ordered should be invoked sequentially as messages are ordered
	// If the current message valid, and no batches need to be cut:
	//   - Ordered will return (nil, true) (indicating ok).
	// If the current message is valid, and batches need to be cut:
	//   - Ordered will return 1 or 2 batches of messages, and true (indicating ok).
	// If the current message is invalid:
	//   - Ordered will return (nil, false) (to indicate not ok).
	//
	// Given a valid message, if the current message needs to be isolated because it exceeds the preferred batch size
	//   - Ordered will return:
	//     * The pending batch (if not empty), and a second batch containing only the isolated message.
	//     * true (indicating ok).
	// Otherwise, given a valid message, the pending batch, if not empty, will be cut and returned if:
	//   - The current message will cause the pending batch size in bytes to exceed BatchSize.PreferredMaxBytes.
	//   - After adding the current message to the pending batch, the message count has reached BatchSize.MaxMessageCount.
	Ordered(msg *cb.Envelope) ([][]*cb.Envelope, bool)

	// Cut returns the current batch and starts a new one
	Cut() []*cb.Envelope
}

Receiver defines a sink for the ordered broadcast messages

func NewReceiverImpl

func NewReceiverImpl(sharedConfigManager config.Orderer) Receiver

NewReceiverImpl creates a Receiver implementation based on the given configtxorderer manager

Jump to

Keyboard shortcuts

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