Skip to content

Instantly share code, notes, and snippets.

@bleonard
Created December 24, 2016 19:14
Show Gist options
  • Save bleonard/58f6db794d6a1f72ebc4b30bc2777a7d to your computer and use it in GitHub Desktop.
Save bleonard/58f6db794d6a1f72ebc4b30bc2777a7d to your computer and use it in GitHub Desktop.
class TaskChangesSubscriber
include ResqueBus::Subscriber
subscribe :task_changed
subscribe :changed_when_opened, "bus_event_type" => "task_changed", "state" => "opened"
def task_changed(attributes)
# gets called for all task changes
end
def changed_when_opened
# only gets called when state == "opened"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment