Documentation
¶
Index ¶
- type Client
- func (red *Client) AddTask(queueID string, task TaskMessage) (int, error)
- func (red *Client) AddTaskFromString(queueID string, message string) (int, error)
- func (red *Client) AddTasksFromFile(queueID, filePath string) (queueLength int, count int, err error)
- func (red *Client) ClearQueue(queueID string) (bool, error)
- func (red *Client) Complete(queueID string, taskID string) (bool, error)
- func (red *Client) DeleteQueue(queueID string) (int, error)
- func (red *Client) Fail(queueID string, taskID string) (bool, error)
- func (red *Client) Heartbeat(queueID string, taskID string, expirationSec int32) (int, error)
- func (red *Client) Info() (string, error)
- func (red *Client) ListQueues() (map[string]QueueInfo, error)
- func (red *Client) Load(ctx context.Context, queueID string, expirationSec int) (TaskMessage, error)
- func (red *Client) Peek(queueID, phase string, limit int) (int, []TaskMessage, error)
- func (red *Client) Progress(queueID string) (QueueInfo, error)
- func (red *Client) SlimLoad(ctx context.Context, queueID string, expirationSec int) (TaskMessage, error)
- type QueueInfo
- type TaskMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client Basic client class to group Redis functions
func NewRougeClient ¶
func (*Client) AddTask ¶
func (red *Client) AddTask(queueID string, task TaskMessage) (int, error)
AddTask adds a new task to a queue.
func (*Client) AddTaskFromString ¶
AddTaskFromString converts a plain string to a task and puts it on the queue
func (*Client) AddTasksFromFile ¶
func (red *Client) AddTasksFromFile(queueID, filePath string) (queueLength int, count int, err error)
AddTasksFromFile is a function for loading from a file
func (*Client) ClearQueue ¶
ClearQueue deletes everything belonging to a given queue.
func (*Client) DeleteQueue ¶ added in v0.5.4
DeleteQueue deletes a queue and all related keys
func (*Client) Info ¶
Info just returns some information about the redis server. We also use it as a health check
func (*Client) ListQueues ¶ added in v0.5.0
ListQueues is implemented in GRPC
func (*Client) Load ¶
func (red *Client) Load(ctx context.Context, queueID string, expirationSec int) (TaskMessage, error)
Load loads a message from the queue, and mark it as processing
func (*Client) Peek ¶
Peek gets a list of the most or least recent items from a given queue and queue phase
type QueueInfo ¶
type QueueInfo struct {
// contains filtered or unexported fields
}
QueueInfo is a type meant for representing progress
func (*QueueInfo) ToBuff ¶
func (obj *QueueInfo) ToBuff() *pb.QueueProgress
ToBuff converts a QueueInfo object to it's protobuf representation
type TaskMessage ¶
type TaskMessage struct { ID string `json:"id"` Body string `json:"body"` Envs []string `json:"envs"` }
TaskMessage is the 'message' format used on our queue
func (*TaskMessage) FromString ¶
func (t *TaskMessage) FromString(ts string) (*TaskMessage, error)
FromString makes a TaskMessage from a string
func (*TaskMessage) ToString ¶
func (t *TaskMessage) ToString() string
ToString converts a taskMessage to a string