tompesman/push-core — pull request #25 by tilo (2014-04-06 05:50:00+00:00)
Title: adding reserved_by and reserved_at to push_messages, so multiple daemons can run

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.