Documentation ¶
Index ¶
- Constants
- Variables
- func HaltOnPanic()
- type TxQueue
- func (q *TxQueue) Count() int
- func (q *TxQueue) Done(id common.QueuedTxID, hash gethcommon.Hash, err error) error
- func (q *TxQueue) Enqueue(tx *common.QueuedTx) error
- func (q *TxQueue) Get(id common.QueuedTxID) (*common.QueuedTx, error)
- func (q *TxQueue) Has(id common.QueuedTxID) bool
- func (q *TxQueue) LockInprogress(id common.QueuedTxID) error
- func (q *TxQueue) Remove(id common.QueuedTxID)
- func (q *TxQueue) Reset()
- func (q *TxQueue) Start()
- func (q *TxQueue) Stop()
Constants ¶
View Source
const ( // DefaultTxQueueCap defines how many items can be queued. DefaultTxQueueCap = int(35) )
Variables ¶
View Source
var ( // ErrQueuedTxExist - transaction was already enqueued ErrQueuedTxExist = errors.New("transaction already exist in queue") //ErrQueuedTxIDNotFound - error transaction hash not found ErrQueuedTxIDNotFound = errors.New("transaction hash not found") //ErrQueuedTxInProgress - error transaction is in progress ErrQueuedTxInProgress = errors.New("transaction is in progress") //ErrInvalidCompleteTxSender - error transaction with invalid sender ErrInvalidCompleteTxSender = errors.New("transaction can only be completed by the same account which created it") )
View Source
var ErrTxQueueRunFailure = errors.New("error running transaction queue")
ErrTxQueueRunFailure - error running transaction queue
Functions ¶
func HaltOnPanic ¶
func HaltOnPanic()
HaltOnPanic recovers from panic, logs issue, sends upward notification, and exits
Types ¶
type TxQueue ¶
type TxQueue struct {
// contains filtered or unexported fields
}
TxQueue is capped container that holds pending transactions
func (*TxQueue) Done ¶
func (q *TxQueue) Done(id common.QueuedTxID, hash gethcommon.Hash, err error) error
Done removes transaction from queue if no error or error is not transient and notify subscribers
func (*TxQueue) Has ¶
func (q *TxQueue) Has(id common.QueuedTxID) bool
Has checks whether transaction with a given identifier exists in queue
func (*TxQueue) LockInprogress ¶
func (q *TxQueue) LockInprogress(id common.QueuedTxID) error
LockInprogress returns error if transaction is already inprogress.
func (*TxQueue) Remove ¶
func (q *TxQueue) Remove(id common.QueuedTxID)
Remove removes transaction by transaction identifier
Click to show internal directories.
Click to hide internal directories.