dispatcher

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 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 models.Task)

func (*Dispatcher) GetStatus

func (d *Dispatcher) GetStatus(ID int) int

func (*Dispatcher) Wait

func (d *Dispatcher) Wait()

type DispatcherBuilder

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

func NewDispatcherBuilder

func NewDispatcherBuilder(ctx context.Context) *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) WithMemorySize

func (db *DispatcherBuilder) WithMemorySize(size int) *DispatcherBuilder

func (*DispatcherBuilder) WithWorkerNumber

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

type Observer

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

func (*Observer) Log

func (o *Observer) Log(result models.TaskResult)

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 SharedMemory

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

func (*SharedMemory) AddTask

func (s *SharedMemory) AddTask(task models.Task)

func (*SharedMemory) EndWorker

func (s *SharedMemory) EndWorker()

func (*SharedMemory) ForwardTask

func (s *SharedMemory) ForwardTask(task models.Task)

func (*SharedMemory) GetStatus

func (s *SharedMemory) GetStatus(ID int) int

func (*SharedMemory) SetStatus

func (s *SharedMemory) SetStatus(ID int, status int)

func (*SharedMemory) StartWorker

func (s *SharedMemory) StartWorker()

type Worker

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

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