orchestrator

package
v0.0.0-...-83d4af4 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLockHandler

func NewLockHandler(rdb *redis.Client) *lockHandler

Types

type Config

type Config struct {
	RedisIP       string
	RedisPort     int
	RedisPassword string
	RedisDB       int
}

func NewConfigFromEnv

func NewConfigFromEnv() Config

type LockHandler

type LockHandler interface {
	AcquireLock(ctx context.Context, key string, acquisitionTimeout time.Duration, lockTimeout time.Duration) (lockID string, err error)
	ReleaseLock(ctx context.Context, key string, lockID string) error
}

type QueueHandler

type QueueHandler interface {
	ExecuteTopTask(ctx context.Context) error
	MoveDueDelayedTasks(ctx context.Context, dueBefore time.Time) error
}

type TaskOrchestrationServer

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

func NewTaskOrchestratorServer

func NewTaskOrchestratorServer(cfg Config) *TaskOrchestrationServer

func (*TaskOrchestrationServer) StartServer

func (s *TaskOrchestrationServer) StartServer(ctx context.Context)

Jump to

Keyboard shortcuts

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