workers

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: GPL-3.0 Imports: 8 Imported by: 1 module, 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 TransactionQueueItem

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

TransactionQueueItem is a wrapper struct on the transaction itself that is used to encapsulate transactions in the priority queue.

type TransactionResponse

type TransactionResponse struct {
	TxHash string
	Error  error
}

TransactionResponse wraps the results provided by the endpoint which will send the transaction in a struct.

type TransactionWorker

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

TransactionWorker handles all transaction stored inside a priority queue. The priority is given by the nonce, meaning that transactions with lower nonce will be sent first.

func NewTransactionWorker

func NewTransactionWorker(context context.Context, proxy interactors.Proxy, intervalToSend time.Duration) *TransactionWorker

NewTransactionWorker creates a new instance of TransactionWorker.

func (*TransactionWorker) AddTransaction

func (tw *TransactionWorker) AddTransaction(transaction *transaction.FrontendTransaction) <-chan *TransactionResponse

AddTransaction will add a transaction to the priority queue (heap) and will create a channel where the promised result will be broadcast on.

Jump to

Keyboard shortcuts

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