Skip to content

Instantly share code, notes, and snippets.

@adri
Created August 28, 2012 12:15
Show Gist options
  • Save adri/3497597 to your computer and use it in GitHub Desktop.
Save adri/3497597 to your computer and use it in GitHub Desktop.
class User
att_reader: username, email, newsletter
end
class UpdateUserEvent extends Event
attr_reader: sheldon_id, user
end
class UserService
def update_user(user)
# expects a User object
event = UpdateUserEvent(user.id, user)
Mpmq.publish event.name, event.data
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment