Documentation
¶
Index ¶
- type CompleteOptions
- type CompleteResult
- type FailedTask
- type NitricQueueClient
- func (q NitricQueueClient) Complete(opts *CompleteOptions) (*CompleteResult, error)
- func (q NitricQueueClient) Receive(opts *ReceiveOptions) (*ReceiveResult, error)
- func (q NitricQueueClient) Send(opts *SendOptions) (*SendResult, error)
- func (q NitricQueueClient) SendBatch(opts *SendBatchOptions) (*SendBatchResult, error)
- type QueueClient
- type ReceiveOptions
- type ReceiveResult
- type SendBatchOptions
- type SendBatchResult
- type SendOptions
- type SendResult
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompleteOptions ¶
type CompleteResult ¶
type CompleteResult struct{}
type FailedTask ¶
FailedTask - A wrapper for returning errors when tasks fail to enqueue
type NitricQueueClient ¶
type NitricQueueClient struct {
// contains filtered or unexported fields
}
func (NitricQueueClient) Complete ¶
func (q NitricQueueClient) Complete(opts *CompleteOptions) (*CompleteResult, error)
Complete - marks a task as successfully completed and removes it from the queue.
All items retrieved through Pop must be Completed or Released so they're not reprocessed or sent to a dead letter queue.
func (NitricQueueClient) Receive ¶
func (q NitricQueueClient) Receive(opts *ReceiveOptions) (*ReceiveResult, error)
Receive - retrieve tasks from the specifed queue. The items returned are contained in a QueueItem which provides context for the source queue and the lease on the tasks. Tasks must be completed using Complete or they will be distributed again or forwarded to a dead letter queue.
func (NitricQueueClient) Send ¶
func (q NitricQueueClient) Send(opts *SendOptions) (*SendResult, error)
Send - Sends a single task to a queue to be processed asynchronously by other services
func (NitricQueueClient) SendBatch ¶
func (q NitricQueueClient) SendBatch(opts *SendBatchOptions) (*SendBatchResult, error)
SendBatch - publishes multiple tasks to a queue to be processed asynchronously by other services
type QueueClient ¶
type QueueClient interface {
Send(opts *SendOptions) (*SendResult, error)
SendBatch(opts *SendBatchOptions) (*SendBatchResult, error)
Receive(opts *ReceiveOptions) (*ReceiveResult, error)
Complete(opts *CompleteOptions) (*CompleteResult, error)
}
func NewQueueClient ¶
func NewQueueClient(conn *grpc.ClientConn) QueueClient
func NewWithClient ¶
func NewWithClient(client v1.QueueClient) QueueClient
type ReceiveOptions ¶
type ReceiveResult ¶
type ReceiveResult struct {
Tasks []*Task
}
type SendBatchOptions ¶
type SendBatchResult ¶
type SendBatchResult struct {
FailedTasks []*FailedTask
}
SendBatchResponse - Response for SendBatch API call
type SendOptions ¶
type SendResult ¶
type SendResult struct{}
type Task ¶
type Task struct {
// ID - Unique ID for the task
ID string
// LeaseID - (Read-Only) LeaseID that can be used to complete this task
LeaseID string
// PayloadType - Deserialization hint for interprocess communication
PayloadType string
// Payload - The payload to include in this task
Payload map[string]interface{}
}