callbackTracker

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-2-Clause, BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager tracks the callbacks for each transfer.

func NewManager

func NewManager() *Manager

NewManager initializes a new callback tracker Manager.

func (*Manager) AddCallback

func (m *Manager) AddCallback(
	tid *ftCrypto.TransferID, cb callback, period time.Duration)

AddCallback adds a callback to the list of callbacks for the given transfer ID and calls it regardless of the callback tracker status.

func (*Manager) Call

func (m *Manager) Call(tid *ftCrypto.TransferID, err error)

Call triggers each callback for the given transfer ID and passes along the given error.

func (*Manager) Delete

func (m *Manager) Delete(tid *ftCrypto.TransferID)

Delete stops all scheduled stoppables for the given transfer and deletes the callbacks from the map.

Jump to

Keyboard shortcuts

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