watchers

package
v1.6.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BProtocolDispatcher deprecated

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

Deprecated: BProtocolDispatcher implements the legacy protocol dispatcher. This implementation is maintained only for backward compatibility with v1.5 nodes. New implementations should use NCL protocol instead. TODO: Remove when v1.5 is no longer supported.

func NewBProtocolDispatcher

func NewBProtocolDispatcher(params BProtocolDispatcherParams) *BProtocolDispatcher

func (*BProtocolDispatcher) HandleEvent

func (d *BProtocolDispatcher) HandleEvent(ctx context.Context, event watcher.Event) error

type BProtocolDispatcherParams

type BProtocolDispatcherParams struct {
	ID             string
	ComputeService compute.Endpoint
	ProtocolRouter *ProtocolRouter
}

type ExecutionCanceller

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

func NewExecutionCanceller

func NewExecutionCanceller(jobStore jobstore.Store) *ExecutionCanceller

NewExecutionCanceller creates a new ExecutionCanceller that watches for and handles execution state changes using the provided job store.

func (*ExecutionCanceller) HandleEvent

func (d *ExecutionCanceller) HandleEvent(ctx context.Context, event watcher.Event) error

HandleEvent implements watcher.EventHandler for NCL protocol

type ExecutionLogger

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

ExecutionLogger handles logging of execution-related events with detailed state transition information

func NewExecutionLogger

func NewExecutionLogger(logger zerolog.Logger) *ExecutionLogger

NewExecutionLogger creates a new ExecutionLogger instance

func (*ExecutionLogger) HandleEvent

func (e *ExecutionLogger) HandleEvent(ctx context.Context, event watcher.Event) error

HandleEvent processes incoming events and logs detailed execution information

type NCLMessageCreator

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

func NewNCLMessageCreator

func NewNCLMessageCreator(params NCLMessageCreatorParams) (*NCLMessageCreator, error)

NewNCLMessageCreator creates a new NCL protocol dispatcher

func (*NCLMessageCreator) CreateMessage

func (d *NCLMessageCreator) CreateMessage(event watcher.Event) (*envelope.Message, error)

type NCLMessageCreatorFactory added in v1.6.0

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

func NewNCLMessageCreatorFactory added in v1.6.0

func NewNCLMessageCreatorFactory(params NCLMessageCreatorFactoryParams) *NCLMessageCreatorFactory

NewNCLMessageCreatorFactory creates a new NCL protocol dispatcher factory

func (*NCLMessageCreatorFactory) CreateMessageCreator added in v1.6.0

func (f *NCLMessageCreatorFactory) CreateMessageCreator(
	ctx context.Context, nodeID string) (nclprotocol.MessageCreator, error)

type NCLMessageCreatorFactoryParams added in v1.6.0

type NCLMessageCreatorFactoryParams struct {
	ProtocolRouter *ProtocolRouter
	SubjectFn      func(nodeID string) string
}

type NCLMessageCreatorParams

type NCLMessageCreatorParams struct {
	NodeID         string
	ProtocolRouter *ProtocolRouter
	SubjectFn      func(nodeID string) string
}

type ProtocolRouter

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

ProtocolRouter routes commands from orchestrator to compute nodes using their supported protocols. It handles command dispatch for job execution, bidding, and cancellation.

func NewProtocolRouter

func NewProtocolRouter(params ProtocolRouterParams) (*ProtocolRouter, error)

NewProtocolRouter creates a new dispatcher that routes compute events to nodes using their preferred protocol

func (*ProtocolRouter) PreferredProtocol

func (d *ProtocolRouter) PreferredProtocol(ctx context.Context, execution *models.Execution) (models.Protocol, error)

PreferredProtocol returns the protocol to use when dispatching an execution

type ProtocolRouterParams

type ProtocolRouterParams struct {
	NodeStore          nodes.Lookup
	SupportedProtocols []models.Protocol
}

ProtocolRouterParams configures a new ProtocolRouter

Jump to

Keyboard shortcuts

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