writer

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Append

func (b *Batch) Append(item BatchItem) int

func (*Batch) Clear

func (b *Batch) Clear() []BatchItem

func (*Batch) Len

func (b *Batch) Len() int

type BatchItem

type BatchItem struct {
	client.Msger
	Done chan error
}

type W

type W struct {
	// BatchInterval is the time to wait between trying to send a batch of messages.
	BatchInterval time.Duration

	// TxTimeout is the maximum amount of time to wait for a transaction to be
	// included in a block after being broadcasted.
	TxTimeout time.Duration

	// Client is the client used to send transactions to the chain.
	Client *client.TxClient

	Logger *slog.Logger

	GasLimit uint64

	Fees sdk.Coins
	// contains filtered or unexported fields
}

func New

func New(
	client *client.TxClient,
	batchSize int,
	batchInterval time.Duration,
	txTimeout time.Duration,
	logger *slog.Logger,
) *W

func (*W) Flush

func (w *W) Flush(ctx context.Context) error

func (*W) Start

func (w *W) Start(ctx context.Context, flushErrors chan error) error

func (*W) Write

func (w *W) Write(ctx context.Context, msg client.Msger) error

Jump to

Keyboard shortcuts

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