batch

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchHandler

type DispatchHandler func(context.Context, *DispatchState) error

type DispatchState added in v0.14.0

type DispatchState struct {
	Persisted fftypes.BatchPersisted
	Messages  []*fftypes.Message
	Data      fftypes.DataArray
	Pins      []*fftypes.Bytes32
}

type DispatcherOptions added in v0.13.0

type DispatcherOptions struct {
	BatchType      fftypes.BatchType
	BatchMaxSize   uint
	BatchMaxBytes  int64
	BatchTimeout   time.Duration
	DisposeTimeout time.Duration
}

type FlushStatus added in v0.13.0

type FlushStatus struct {
	LastFlushTime        *fftypes.FFTime `json:"lastFlushStartTime"`
	Flushing             *fftypes.UUID   `json:"flushing,omitempty"`
	Blocked              bool            `json:"blocked"`
	LastFlushError       string          `json:"lastFlushError,omitempty"`
	LastFlushErrorTime   *fftypes.FFTime `json:"lastFlushErrorTime,omitempty"`
	AverageBatchBytes    int64           `json:"averageBatchBytes"`
	AverageBatchMessages float64         `json:"averageBatchMessages"`
	AverageBatchData     float64         `json:"averageBatchData"`
	AverageFlushTimeMS   int64           `json:"averageFlushTimeMS"`
	TotalBatches         int64           `json:"totalBatches"`
	TotalErrors          int64           `json:"totalErrors"`
	// contains filtered or unexported fields
}

FlushStatus is an object that can be returned on REST queries to understand the status of the batch processor

type Manager

type Manager interface {
	RegisterDispatcher(name string, txType fftypes.TransactionType, msgTypes []fftypes.MessageType, handler DispatchHandler, batchOptions DispatcherOptions)
	NewMessages() chan<- int64
	Start() error
	Close()
	WaitStop()
	Status() *ManagerStatus
}

type ManagerStatus added in v0.13.0

type ManagerStatus struct {
	Processors []*ProcessorStatus `json:"processors"`
}

type ProcessorStatus added in v0.13.0

type ProcessorStatus struct {
	Dispatcher string      `json:"dispatcher"`
	Name       string      `json:"name"`
	Status     FlushStatus `json:"status"`
}

Jump to

Keyboard shortcuts

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