eventhandler

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 25 Imported by: 75

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleEngineEvents

func HandleEngineEvents(ctx context.Context, taskEngine engine.TaskEngine, client ecs.ECSClient,
	taskHandler *TaskHandler, attachmentEventHandler *AttachmentEventHandler)

HandleEngineEvents handles state change events from the state change event channel by sending it to responsible event handler

Types

type AttachmentEventHandler

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

AttachmentEventHandler is a handler that is responsible for submitting attachment state change events to backend

func NewAttachmentEventHandler

func NewAttachmentEventHandler(ctx context.Context,
	dataClient data.Client,
	client ecs.ECSClient) *AttachmentEventHandler

NewAttachmentEventHandler returns a new AttachmentEventHandler object

func (*AttachmentEventHandler) AddStateChangeEvent

func (eventHandler *AttachmentEventHandler) AddStateChangeEvent(change statechange.Event) error

AddStateChangeEvent adds a state change event to AttachmentEventHandler for it to handle

type TaskHandler

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

TaskHandler encapsulates the the map of a task arn to task and container events associated with said task

func NewTaskHandler

func NewTaskHandler(ctx context.Context,
	dataClient data.Client,
	state dockerstate.TaskEngineState,
	client ecs.ECSClient) *TaskHandler

NewTaskHandler returns a pointer to TaskHandler

func (*TaskHandler) AddStateChangeEvent

func (handler *TaskHandler) AddStateChangeEvent(change statechange.Event, client ecs.ECSClient) error

AddStateChangeEvent queues up the state change event to be sent to ECS. If the event is for a container state change, it just gets added to the handler.tasksToContainerStates map. If the event is for a managed agent state change, it just gets added to the handler.tasksToManagedAgentStates map. If the event is for task state change, it triggers the non-blocking handler.submitTaskEvents method to submit the batched container state changes and the task state change to ECS

Jump to

Keyboard shortcuts

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