dispatcher

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 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 Dispatcher

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

func (*Dispatcher) AddTask

func (d *Dispatcher) AddTask(task tasks.Task)

func (*Dispatcher) Status added in v0.6.1

func (d *Dispatcher) Status(taskId int) int

func (*Dispatcher) Wait

func (d *Dispatcher) Wait()

type DispatcherBuilder

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

func NewBuilder added in v0.6.1

func NewBuilder() *DispatcherBuilder

func (*DispatcherBuilder) Build

func (db *DispatcherBuilder) Build() (Dispatcher, error)

func (*DispatcherBuilder) WithConsole

func (db *DispatcherBuilder) WithConsole() *DispatcherBuilder

func (*DispatcherBuilder) WithLogfile

func (db *DispatcherBuilder) WithLogfile(filename string) *DispatcherBuilder

func (*DispatcherBuilder) WithWorkerNumber

func (db *DispatcherBuilder) WithWorkerNumber(count int) *DispatcherBuilder

type Memory added in v0.6.1

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

func NewMemory added in v0.6.1

func NewMemory() *Memory

func (*Memory) AddTask added in v0.6.1

func (m *Memory) AddTask(task tasks.Task)

func (*Memory) EndWorker added in v0.6.1

func (m *Memory) EndWorker()

func (*Memory) ForwardTask added in v0.6.1

func (m *Memory) ForwardTask(task tasks.Task)

func (*Memory) SetStatus added in v0.6.1

func (m *Memory) SetStatus(taskId int, status int)

func (*Memory) StartWorker added in v0.6.1

func (m *Memory) StartWorker()

func (*Memory) Status added in v0.6.1

func (m *Memory) Status(taskId int) int

func (*Memory) WaitForTasks added in v0.6.1

func (m *Memory) WaitForTasks()

func (*Memory) WaitForWorkers added in v0.6.1

func (m *Memory) WaitForWorkers()

type Observer

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

func NewObserver added in v0.6.1

func NewObserver(memory *Memory, ctx context.Context) *Observer

func (*Observer) Log

func (o *Observer) Log(result tasks.Result)

func (*Observer) Start

func (o *Observer) Start()

func (*Observer) WithConsole

func (o *Observer) WithConsole()

func (*Observer) WithTrace

func (o *Observer) WithTrace(filename string) error

type Worker

type Worker struct {
	ID int
	// contains filtered or unexported fields
}

func NewWorker added in v0.6.1

func NewWorker(memory *Memory, ctx context.Context) *Worker

func (*Worker) Start

func (w *Worker) Start()

Jump to

Keyboard shortcuts

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