Documentation
¶
Index ¶
- Variables
- func LoadRoutine(grpcDriver *GRPCDriver, number int, channel chan bool)
- type GRPCDriver
- func (g GRPCDriver) Complete(workCtx context.Context, queueID, taskID string) *pb.StatusMessage
- func (g GRPCDriver) DeleteQueue(queueID string) (*pb.StatusMessage, error)
- func (g GRPCDriver) Fail(workCtx context.Context, queueID, taskID string) *pb.StatusMessage
- func (g GRPCDriver) GetHealth() (status *pb.StatusMessage, err error)
- func (g GRPCDriver) HeartBeat(queueID, taskID string) (*pb.StatusMessage, error)
- func (g GRPCDriver) ListQueues(sortBy string) (queues *pb.QueueList, err error)
- func (g GRPCDriver) LoadTask(ctx context.Context, queueID string) (task *pb.Task, err error)
- func (g GRPCDriver) Peek(queueID, phase string, limit int32) (taskList *pb.TaskList, err error)
- func (g GRPCDriver) Progress(queueID string) (progress *pb.QueueProgress, err error)
- func (g GRPCDriver) PushTask(task *pb.Task) (*pb.StatusMessage, error)
- type MoulinConnectionConfig
Constants ¶
This section is empty.
Variables ¶
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) 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
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