Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgumentType ¶
type ArgumentType interface{}
type Client ¶
type Client interface {
// RegisterFunction registers a consumer function for a queue
RegisterFunction(queueName string, function WorkerFunctionType) error
// EnqueueTask enqueues a task to a queue
EnqueueTask(queueName string, argument ArgumentType) error
// StartConsumers is a blocking function that starts the consumers for all the registered queues
StartConsumers(nowait bool) error
// WaitForConsumers is a blocking function that waits for all the consumers to finish
WaitForConsumers()
// EnqueueProcessingQueueExpiredTask enqueues tasks from processing queue to the original queue
EnqueueProcessingQueueExpiredTask() error
// PurgeQueue purges all the messages from a queue
PurgeQueue(queueName string) error
// ListMessages returns the messages of a queue
// Note: Should be called when no consumers are running
ListMessages(queueName string) ([]string, error)
}
type EnqueuedTask ¶
EnqueuedTask holds the task details Add EnqueuedTask to gorm migration
type Options ¶
type Options struct {
Type ServiceType
NoOfWorkersPerQueue int
MaxMessagesPerQueue int // only applicable for local task queue
DbClient *gorm.DB // only applicable for local task queue
// Extra options for remote task queue
RemoteQueueType RemoteQueueType
// Redis specific options
RedisClient *redis.Client
// AMQP specific options
AMQPUri string
AMQPVhost string
AMQPClientName string
}
type RemoteQueueType ¶
type RemoteQueueType string
const ( AmqpQueue RemoteQueueType = "amqp" RedisQueue RemoteQueueType = "redis" NoneRemoteQueue RemoteQueueType = "none" )
type ServiceType ¶
type ServiceType string
const ( Local ServiceType = "local" Remote ServiceType = "remote" )
type WorkerFunctionType ¶
type WorkerFunctionType interface{}
Click to show internal directories.
Click to hide internal directories.