broadcaster

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(ctx sdkClient.Context, txf tx.Factory, msgs []sdk.Msg) (*sdk.TxResponse, error)

Broadcast bundles the given messages into a single transaction and submits it to the blockchain. If there are more than one message, all messages must have the single same signer

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

Broadcaster submits transactions to a tendermint node

func NewBroadcaster

func NewBroadcaster(txf tx.Factory, pipeline types.Pipeline, logger log.Logger) *Broadcaster

NewBroadcaster returns a broadcaster to submit transactions to the blockchain. Only one instance of a broadcaster should be run for a given account, otherwise risk conflicting sequence numbers for submitted transactions.

func (*Broadcaster) Broadcast

func (b *Broadcaster) Broadcast(ctx sdkClient.Context, msgs ...sdk.Msg) (*sdk.TxResponse, error)

Broadcast sends the passed messages to the network. This function in thread-safe.

type RetryPipeline

type RetryPipeline struct {
	// contains filtered or unexported fields
}

RetryPipeline manages serialized execution of functions with retry on error

func NewPipelineWithRetry

func NewPipelineWithRetry(cap int, maxRetries int, backOffStrategy utils.BackOff, logger log.Logger) *RetryPipeline

NewPipelineWithRetry returns a pipeline with the given configuration

func (RetryPipeline) Close

func (p RetryPipeline) Close()

Close closes the pipeline

func (RetryPipeline) Push

func (p RetryPipeline) Push(f func() error, retryOnError func(error) bool) error

Push adds the given function to the serialized execution pipeline

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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