Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created November 9, 2012 01:41
Show Gist options
  • Select an option

  • Save cablehead/4043178 to your computer and use it in GitHub Desktop.

Select an option

Save cablehead/4043178 to your computer and use it in GitHub Desktop.
flows:
message new ->
channel_command append new
for user in room:
notify user
notifier.send user channel_id, message
cache incr channel_id, user.id
counts[user.id] += 1
for device in user.devices:
device_service.send(message badge=counts[user.id])
notifier.clear user channel_id
cache get old and set to 0 channel_id, user.id
counts[user.id] -= old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment