client

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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(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(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, expirationSec int32) *pb.StatusMessage

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() (queues map[string]*pb.QueueProgress, err error)

ListQueues returns a list of Progress structs

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

Jump to

Keyboard shortcuts

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