taskmanager

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RedisServer     string
	RedisPassword   string
	TodoList        string
	BackfillEnabled bool
}

type Manager

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

func New

func New(tracker *bestblock.Tracker, lag int64, metrics *metrics.Provider, config Config) (*Manager, error)

New instantiates a new task manager and also takes care of the redis connection management it subscribes to the best block tracker for new blocks which it'll add to the redis queue automatically

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) FeedToChan

func (m *Manager) FeedToChan(c chan int64)

FeedToChan continuously executes blocking pops from the redis queue and sends the resulting task on the provided channel Highest blocks have priority

func (*Manager) IsPaused added in v1.0.0

func (m *Manager) IsPaused() bool

func (*Manager) Pause added in v1.0.0

func (m *Manager) Pause()

func (*Manager) Reset added in v1.0.0

func (m *Manager) Reset() error

func (*Manager) Resume added in v1.0.0

func (m *Manager) Resume()

func (*Manager) Todo

func (m *Manager) Todo(block int64) error

Todo inserts a block into the redis sorted set used for queue management using a ZADD command

Jump to

Keyboard shortcuts

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