client

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientConfig = MoulinConnectionConfig{
	LoadTaskTimeOut:           30 * time.Second,
	HeartBeatInterval:         2 * time.Minute,
	ServerUnavailableTimeOut:  1 * time.Hour,
	TaskExpirationTime:        5 * time.Minute,
	MaxBetweenCompleteRetries: 1 * time.Minute,
}

ClientConfig is the (default) configuration for the client (timeouts etc)

Functions

func LoadRoutine

func LoadRoutine(grpcDriver *GRPCDriver, number int, channel chan bool)

LoadRoutine is not a test on its own.

Types

type GRPCDriver

type GRPCDriver struct {
	Connection *grpc.ClientConn
	// contains filtered or unexported fields
}

GRPCDriver is the main instance

func NewGRPCDriver

func NewGRPCDriver() *GRPCDriver

NewGRPCDriver creates and initializes a new GRPC client and connection

func (GRPCDriver) Complete

func (g GRPCDriver) Complete(workCtx context.Context, queueID, taskID string) *pb.StatusMessage

Complete moves the task from the running set to the completed set

func (GRPCDriver) DeleteQueue added in v0.5.4

func (g GRPCDriver) DeleteQueue(queueID string) (*pb.StatusMessage, error)

DeleteQueue deletes a queue

func (GRPCDriver) Fail added in v0.4.2

func (g GRPCDriver) Fail(workCtx context.Context, queueID, taskID string) *pb.StatusMessage

Fail marks the task as failed by pushing it to the failed set

func (GRPCDriver) GetHealth

func (g GRPCDriver) GetHealth() (status *pb.StatusMessage, err error)

GetHealth just checks if everything, including Redis is healthy

func (GRPCDriver) HeartBeat

func (g GRPCDriver) HeartBeat(queueID, taskID string) (*pb.StatusMessage, error)

HeartBeat updates the expiry of an item on the running set ToDo: add a timeout, for testing

func (GRPCDriver) ListQueues added in v0.4.2

func (g GRPCDriver) ListQueues(sortBy string) (queues *pb.QueueList, err error)

ListQueues returns a list of ListInfo

func (GRPCDriver) LoadTask

func (g GRPCDriver) LoadTask(ctx context.Context, queueID string) (task *pb.Task, err error)

LoadTask loads a task from the queue

func (GRPCDriver) Peek

func (g GRPCDriver) Peek(queueID, phase string, limit int32) (taskList *pb.TaskList, err error)

Peek get the n (limit) 'next' messages for a given queue/phase

func (GRPCDriver) Progress

func (g GRPCDriver) Progress(queueID string) (progress *pb.QueueProgress, err error)

Progress gets the status for a queue

func (GRPCDriver) PushTask

func (g GRPCDriver) PushTask(task *pb.Task) (*pb.StatusMessage, error)

PushTask pushes a task onto the queue

type MoulinConnectionConfig added in v0.5.5

type MoulinConnectionConfig struct {
	LoadTaskTimeOut           time.Duration // LoadTaskTimeOut is how long we wait for a task to be loaded (when we are doing `until finished`)
	HeartBeatInterval         time.Duration // HeartBeatInterval is the time between heartbeats
	ServerUnavailableTimeOut  time.Duration // ServerUnavailableTimeOut is how long we accept the server to be down before we consider it dead and quit
	TaskExpirationTime        time.Duration // taskExpirationTime is how much time is allowed before the task is considered expired
	MaxBetweenCompleteRetries time.Duration // MaxDurationCompleteRetries is the maximum between retries of complete task
}

MoulinConnectionConfig defines a configuration for timeouts

Jump to

Keyboard shortcuts

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