taskmanager

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 5 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
}

type Manager

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

func New

func New(tracker *bestblock.Tracker, lag int64, 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) 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