chronomq

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

###A simple beanstalkd-like job queue implementation in go

Goals

  • Start with a in-memory data structure
  • Support beanstalkd wire protocol?
  • Make all Job operations zero-copy
  • Allow a disk mapped mode (fully mapped, lazily mapped, full in-mem)

Architecture

The most fitting architectural analogy for this is to imagine a bicycle wheel. This wheel spins only in the forward direction (arrow-of-time). At any instant, a Spoke of the wheel is active. The central Hub connects all Spokes and is responsible for rotating through them.

An active Spoke is a Spoke whose:

  • Start Time is <= SystemTime::now &&
  • SystemTime::now <= the Start Time + Active Duration

No two spokes can have overlapping intervals of time responsibility. [TODO: Add unit test]

Each Spoke points to a list of Jobs that should trigger sometime during the spoke's time bounds - asking a Spoke for ready jobs is called Spoke walking.

A Special spoke called the Past Spoke is maintained by the Hub to handle incoming jobs whose trigger time is in the past. The Hub walks this spoke before walking any spoke at the start of each rotation. This way, we maintain a total order on trigger_at times for all Jobs that we accept responsibility for.

  • ulimit -Sv 500000 500mb mem limit for load testing mem leaks locally

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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