package mem
import "go.dedis.ch/dela/core/txn/pool/mem"
Index ¶
- type Pool
- func NewPool() *Pool
- func (p *Pool) Add(tx txn.Transaction) error
- func (p *Pool) AddFilter(filter pool.Filter)
- func (p *Pool) Close() error
- func (p *Pool) Gather(ctx context.Context, cfg pool.Config) []txn.Transaction
- func (p *Pool) Remove(tx txn.Transaction) error
- func (p *Pool) ResetStats()
- func (p *Pool) SetPlayers(mino.Players) error
- func (p *Pool) Stats() pool.Stats
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a in-memory transaction pool. It only accepts transactions from a local client and it does not support asynchronous calls.
- implements pool.Pool
func NewPool ¶
func NewPool() *Pool
NewPool creates a new service.
func (*Pool) Add ¶
func (p *Pool) Add(tx txn.Transaction) error
Add implements pool.Pool. It adds the transaction to the pool of waiting transactions.
func (*Pool) AddFilter ¶
AddFilter implements pool.Pool. It adds the filter to the gatherer.
func (*Pool) Close ¶
Close implements pool.Pool. It cleans the resources of the gatherer.
func (*Pool) Gather ¶
Gather implements pool.Pool. It gathers the transactions of the pool and return them.
func (*Pool) Remove ¶
func (p *Pool) Remove(tx txn.Transaction) error
Remove implements pool.Pool. It removes the transaction from the pool if it exists, otherwise it returns an error.
func (*Pool) ResetStats ¶
func (p *Pool) ResetStats()
ResetStats implements pool.Pool. It resets the transaction statistics.
func (*Pool) SetPlayers ¶
SetPlayers implements pool.Pool. It does nothing as the pool is in-memory and only shares the transactions to the host.
func (*Pool) Stats ¶
Stats implements pool.Pool. It gets the transaction statistics.
Source Files ¶
mem.go
- Version
- v0.1.0 (latest)
- Published
- Apr 10, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 month ago –
Tools for package owners.