queue

command
v1.0.1-0...-7ff242b Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: MIT Imports: 6 Imported by: 0

README

Task Priority


Cogman sorts the tasks into two priorities.

- TaskPriorityHigh  
- TaskPriorityLow  

Queue configuration


Cogman processes low and high priority task separately. It maintains two types of queue: High Priority Queue & Low Priority Queue. Based on task priority, it will be pushed to one of these queues. The number of queues can be configured for better throughput.

cfg := &config.Config{
    ConnectionTimeout: time.Minute * 10, // optional
    RequestTimeout:    time.Second * 5,  // optional

    AmqpURI:  "amqp://localhost:5672",                  // required
    RedisURI: "redis://localhost:6379/0",               // required
    MongoURI: "mongodb://root:secret@localhost:27017/", // optional

    HighPriorityQueueCount: 2, // optional. default value 1
    LowPriorityQueueCount:  1, // optional. default value 1

    ReEnqueue: true, // optional. default false. Mongo connection also needed
}

Cogman hight_priority_queue implemented over amqp's default queue. And low_priority_queue implemented over lazy queue. Cogman Queues are persistent.

Note: In default case, there will be at least one high Priority queue and one low priority queue.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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