teslamotors/push-core — pull request #5 by tilo (2014-04-06 05:58:32+00:00)
Title: Feature/add reservations to messages for multiple daemons

this adds columns :reserved_by and :reserved_until to allow multiple daemons to run on different hosts
without sending notifications multiple times.

Each running daemon will use it's own id (hostname + PID) to reserve notifications, and mark them
reserved_until a given time.

The main loop of the feeder is modified to first sweep expired reservations, and then deliver notifications.

When delivering notifications, it first reserves up to MAX_TASKS notifications per app type, and then
delivers them

this needs the other pull request which allows multiple migrations.
Users which upgrade to this need to re-run 'rails g push' to create the missing migrations.