tasks

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PING = iota + 1
	ASK_PEERS

	MINE_MICRO

	PersistComplete
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AskPeersTask

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

func NewAskPeersTask

func NewAskPeersTask(d time.Duration) AskPeersTask

func (AskPeersTask) Run

func (a AskPeersTask) Run(ctx context.Context, output chan AsyncTask) error

func (AskPeersTask) Type

func (a AskPeersTask) Type() int

type AsyncTask

type AsyncTask struct {
	TaskType int
	Data     interface{}
}

type MineMicroTask

type MineMicroTask struct {
	MineMicroTaskData MineMicroTaskData
	// contains filtered or unexported fields
}

func NewMineMicroTask

func NewMineMicroTask(timeout time.Duration, block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, vrf []byte) MineMicroTask

func (MineMicroTask) Run

func (a MineMicroTask) Run(ctx context.Context, output chan AsyncTask) error

func (MineMicroTask) Type

func (MineMicroTask) Type() int

type MineMicroTaskData

type MineMicroTaskData struct {
	Block   *proto.Block
	Limits  proto.MiningLimits
	KeyPair proto.KeyPair
	Vrf     []byte
}

type PingTask

type PingTask struct {
}

func (PingTask) Run

func (PingTask) Run(ctx context.Context, output chan AsyncTask) error

func (PingTask) Type

func (PingTask) Type() int

type Task

type Task interface {
	Run(ctx context.Context, output chan AsyncTask) error
	Type() int
}

func NewFuncTask

func NewFuncTask(f func(ctx context.Context, output chan AsyncTask) error, taskType int) Task

func NewPingTask

func NewPingTask() Task

func Tasks

func Tasks(tasks ...Task) []Task

type TaskType

type TaskType int

Jump to

Keyboard shortcuts

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