poller

package
v1.0.0-beta.15....-0de5f12 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// emitted when a broadcasted transfer got confirmed
	EventTransferConfirmed event.Event = 100
	// emitted when a deposit is being received
	EventReceivingDeposit event.Event = 101
	// emitted when a deposit is confirmed
	EventReceivedDeposit event.Event = 102
	// emitted when a zero value transaction is received
	EventReceivedMessage event.Event = 103
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ReceiveEventFilter

type ReceiveEventFilter func(eventMachine event.EventMachine, bndls bundle.Bundles, depAddrs StringSet, spentAddrs StringSet)

ReceiveEventFilter filters and creates events given the incoming bundles, deposit addresses and spent addresses. It's the job of the ReceiveEventFilter to emit the appropriate events through the given EventMachine.

func NewPerTailReceiveEventFilter

func NewPerTailReceiveEventFilter(skipFirst ...bool) ReceiveEventFilter

PerTailFilter filters receiving/received bundles by the bundle's tail transaction hash. Optionally takes in a bool flag indicating whether the first pass of the event filter should not emit any events.

type ReceiveEventTuple

type ReceiveEventTuple struct {
	Event  event.Event
	Bundle bundle.Bundle
}

type StringSet

type StringSet map[string]struct{}

StringSet is a set of strings.

type TransferPoller

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

TransferPoller is an account plugin which takes care of checking pending transfers for confirmation and checking incoming transfers.

func NewTransferPoller

func NewTransferPoller(setts *account.Settings, filter ReceiveEventFilter, interval time.Duration) *TransferPoller

NewTransferPoller creates a new TransferPoller. If the interval is set to 0, the TransferPoller will only poll through Poll().

func (*TransferPoller) Name

func (tp *TransferPoller) Name() string

func (*TransferPoller) Poll

func (tp *TransferPoller) Poll() error

Poll awaits the current transfer polling task to finish (in case it's ongoing), pauses the repeated task, does a manual polling, resumes the repeated task and then returns. Poll will block infinitely if called after the account has been shutdown.

func (*TransferPoller) Shutdown

func (tp *TransferPoller) Shutdown() error

func (*TransferPoller) Start

func (tp *TransferPoller) Start(acc account.Account) error

Jump to

Keyboard shortcuts

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