Documentation ¶
Overview ¶
Package delay implements a Altipla Queues Go SDK to send tasks and listen to them later to run them in a distributed background process.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection to the queues server.
func NewConn ¶
NewConn opens a new connection to a queues server. It needs the project and the OAuth client credentials to authenticate the requests.
func NewDebugConn ¶ added in v1.1.0
NewDebugConn creates a new local debugging connection that uses a direct Redis queue to simulate the queue. The downside is both the sender and receiver should be connected at the same time to send the message; there is no storage.
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function is a stored task implementation.
func (*Function) Call ¶
Call builds a task invocation and directly sends it individually to the queue.
If you are going to send multiple tasks at the same time is more efficient to build all of them with Task() first and then send them in batches with queue.SendTasks(). If sending a single task this function will be similar in performance to the batch method described before.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is a background goroutine that handles messages from the queues and run them in other controlled goroutines.
func NewListener ¶
NewListener prepares a new background goroutine to handle messages.