Skip to content

Instantly share code, notes, and snippets.

@we4tech
Created September 21, 2013 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save we4tech/6647596 to your computer and use it in GitHub Desktop.
Save we4tech/6647596 to your computer and use it in GitHub Desktop.
Instead of relying on 3rd party service, we could wrap them in bridge or expose through factory or facade
def handle_action_created(action)
if action.from.kind_of?(Source)
$redis.lpush(
"#{self.class.name}:#{self.id}",
[action.from.node.id, action.from.node.neo_id].join(":")
)
end
end
# Perhaps we could do
def handle_action_created(action)
if action.from.kind_of?(Source)
RedisService.addJob(
"#{self.class.name}:#{self.id}",
[action.from.node.id, action.from.node.neo_id])
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment