scheduler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopTaskId

func PopTaskId(
	keyName string,
	retTaskId *taskmodel.TaskIdType,
) error

取队首的任务ID元素

func ScheduleTaskInQueue

func ScheduleTaskInQueue(
	keyName string,
	retTaskId *taskmodel.TaskIdType,
	noTask *bool,
) error

从队列中取出任务ID

Types

type FCFSScheduler

type FCFSScheduler struct {
	QueueKeyName string // 队列的Key名
}

FCFS调度算法

func (*FCFSScheduler) Schedule

func (scheduler *FCFSScheduler) Schedule(
	retTaskId *taskmodel.TaskIdType,
	noTask *bool,
) error

FCFS调度算法

type IQueueScheduler

type IQueueScheduler interface {
	Schedule(taskId *taskmodel.TaskIdType, noTask *bool) error
}

type RRScheduler

type RRScheduler struct {
	QueueKeyName string
}

RR调度算法

func (*RRScheduler) Schedule

func (scheduler *RRScheduler) Schedule(
	retTaskId *taskmodel.TaskIdType,
	noTask *bool,
) error

RR调度算法

Jump to

Keyboard shortcuts

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