message

package
v0.0.0-...-f6ab670 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 13

Documentation

Overview

Package message contains information for the IPC messages.

Package message contains information for the IPC messages

Index

Constants

View Source
const (
	LongRunning WorkerType = "LongRunning"
	OnDemand    WorkerType = "OnDemand"

	SchemaVersion = 1

	GetWorkerHealthRequest TopicType = "GetWorkerHealthRequest"
	GetWorkerHealthResult  TopicType = "GetWorkerHealthResult"
	TerminateWorkerRequest TopicType = "TerminateWorkerRequest"
	TerminateWorkerResult  TopicType = "TerminateWorkerResult"
)

Variables

View Source
var (
	DefaultIPCPrefix         = "ipc://"
	DefaultCoreAgentChannel  = appconfig.AgentData + "ipc/"
	GetWorkerHealthChannel   = DefaultIPCPrefix + DefaultCoreAgentChannel + "health"
	TerminationWorkerChannel = DefaultIPCPrefix + DefaultCoreAgentChannel + "termination"
)

Functions

This section is empty.

Types

type HealthResultPayload

type HealthResultPayload struct {
	SchemaVersion int
	Name          string
	WorkerType    WorkerType
	Pid           int
}

HealthResultPayload contains information required by Core Agent to decide if a worker is healthy

type Message

type Message struct {
	SchemaVersion int
	Topic         TopicType
	Payload       []byte
}

func CreateHealthRequest

func CreateHealthRequest() *Message

CreateHealthRequest creates an instance of health request message

func CreateHealthResult

func CreateHealthResult(workerName string, workerType WorkerType, pid int) (*Message, error)

CreateHealthResult creates an instance of health result message

func CreateTerminateWorkerRequest

func CreateTerminateWorkerRequest() *Message

CreateTerminateWorkerRequest creates an instance of terminate worker request message

func CreateTerminateWorkerResult

func CreateTerminateWorkerResult(
	workerName string,
	workerType WorkerType,
	pid int,
	isTerminating bool) (*Message, error)

CreateTerminateWorkerRequest creates an instance of terminate worker result message

type TerminateWorkerResultPayload

type TerminateWorkerResultPayload struct {
	SchemaVersion int
	Name          string
	WorkerType    WorkerType
	Pid           int
	IsTerminating bool
}

TerminateWorkerResultPayload contains worker termination result

type TopicType

type TopicType string

TopicType is the message type for IPC messages

type WorkerType

type WorkerType string

WorkerType is the type of the worker

Jump to

Keyboard shortcuts

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