queues

package
v0.9.0-rc.35 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailedTask

type FailedTask struct {
	// Task - The task that failed to queue
	Task *Task
	// Reason - Reason for the failure
	Reason string
}

type Queue

type Queue interface {
	// Name - The name of the queue
	Name() string
	// Send - Push a number of tasks to a queue
	Send(context.Context, []*Task) ([]*FailedTask, error)
	// Receive - Retrieve tasks from a queue to a maximum of the given depth
	Receive(context.Context, int) ([]ReceivedTask, error)
}

Queue is a resource for async send/receive messaging.

type Queues

type Queues interface {
	Queue(string) Queue
}

Queues - Idiomatic interface for the nitric queue service

func New

func New() (Queues, error)

New - Construct a new Queueing Client with default options

type ReceivedTask

type ReceivedTask interface {
	// Queue - Returns the name of the queue this task was retrieved from
	Queue() string
	// Task - Returns the Task data contained in this Received Task instance
	Task() *Task
	// Complete - Completes the task removing it from the queue
	Complete(context.Context) error
}

type Task

type Task struct {
	// ID - Unique ID for the task
	ID string
	// PayloadType - Deserialization hint for interprocess communication
	PayloadType string
	// Payload - The payload to include in this task
	Payload map[string]interface{}
}

Jump to

Keyboard shortcuts

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