memory

package
v0.0.0-...-71ad85e Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Concurency uint = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	Wait         *Queue
	Work         *Queue
	Done         *Queue
	InputChannel chan *scheduler.Task
	DemoLock     *demolock.DemoLock
	// contains filtered or unexported fields
}

func New

func New(concurrency uint) (memory *Memory)

func (*Memory) Add

func (m *Memory) Add(payload *job.Job, executionTimeout time.Duration, userID string) (taskID string)

Adds task to queue (wait)

func (*Memory) GetTaskStatus

func (m *Memory) GetTaskStatus(taskID string) (info []byte, userID string)

func (*Memory) ListAllTasks

func (m *Memory) ListAllTasks() (tasks []*scheduler.Task)

func (*Memory) MoveToWorkQeueu

func (m *Memory) MoveToWorkQeueu(taskID string) (err error)

Move Item from the Wait to the Work queue

type Queue

type Queue struct {
	Tasks *[]*scheduler.Task
	Mutex sync.Mutex
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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