Skip to content
Miniature extendable queue orchestration system
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Murder of crows

Codacy Badge

Miniature extendable queue orchestration library, capable of creating multiple equal sized queues that can be consumed in parallel without needing to lock the entire queue for processing from a single worker.


Create a Murder object to manage queues, assigning a Crow object as an adapter to communicate with any atomic-enabled system, a RedisCrow is built into the library.

import ""
import "redis.v5"
import "fmt"

func main() {
  redisClient := redis.NewClient(&redis.Options{Addr: "", Password: "", DB: 0})
  redisCrow := &murder.RedisCrow{Redis: redisClient}
  // Create a new murder instance with 100 as a bulk size, 1 second TTL and a worker_group_name
  // Worker group name separates different queue systems by prefixing them
  // 100 is a rough number as no locking is used in enqueueing to speed this operation up, the actual queue size will be >= 100
  murderInstance := murder.NewMurder(100, 1, redisCrow, "worker_group_name") 

  for (i := 0; i < 100; i++) {

  lockKey, locked := murderInstance.Lock() // This locks a full queue giving only the worker with lockKey access to it

  if (locked) { // this may be false if there are no full queues
    jobs := murderInstance.Get(lockKey) // jobs are always returned as an array of strings

    for _, obj := range jobs { // Prints out 0 through 99
      fmt.Printf("%s\n", obj)
You can’t perform that action at this time.