api

package
v0.2102.1 Latest Latest
Warning

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

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

Documentation

Overview

Package api implements the transaction scheduler algorithm API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler interface {
	// Name is the scheduler algorithm name.
	Name() string

	// QueueTx queues a transaction for scheduling.
	QueueTx(tx *transaction.CheckedTransaction) error

	// RemoveTxBatch removes a transaction batch.
	RemoveTxBatch(tx []hash.Hash) error

	// GetBatch returns a batch of scheduled transactions (if any is available).
	GetBatch(force bool) []*transaction.CheckedTransaction

	// UnscheduledSize returns number of unscheduled items.
	UnscheduledSize() uint64

	// IsQueued returns if a transaction is queued.
	IsQueued(hash.Hash) bool

	// UpdateParameters updates the scheduling parameters.
	UpdateParameters(algo string, weightLimits map[transaction.Weight]uint64) error

	// Clear clears the transaction queue.
	Clear()
}

Scheduler defines an algorithm for scheduling incoming transactions.

Jump to

Keyboard shortcuts

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