dispatcher

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AsyncDispatchLimit         int32
	AsyncDispatchCheckInterval = 3 * time.Second
	DispatchTimeout            time.Duration
)

Functions

func Dispatch

func Dispatch(event events.SchedulingEvent)

dispatches scheduler events to actual app/task handler, each app/task has its own state machine and maintain their own states. currently all events share same channel, so they are dispatched one by one in order.

func RegisterEventHandler

func RegisterEventHandler(handlerID string, eventType EventType, handlerFn func(interface{}))

func Start

func Start()

func Stop

func Stop()

stop the dispatcher and wait at most 5 seconds gracefully

func UnregisterAllEventHandlers added in v1.5.0

func UnregisterAllEventHandlers()

func UnregisterEventHandler added in v1.5.0

func UnregisterEventHandler(handlerID string, eventType EventType)

Types

type Dispatcher

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

central dispatcher that dispatches scheduling events.

type EventType

type EventType int8
const (
	EventTypeApp EventType = iota
	EventTypeTask
	EventTypeNode
)

Jump to

Keyboard shortcuts

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