workers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

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