Skip to content

Instantly share code, notes, and snippets.

@ben-ole
Created July 3, 2018 12:37
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 ben-ole/4dfedfc6014020662a3d8604b4de8a1f to your computer and use it in GitHub Desktop.
Save ben-ole/4dfedfc6014020662a3d8604b4de8a1f to your computer and use it in GitHub Desktop.
KaufmannEx EventHandler 1
defmodule Sample.EventHandler do
alias KaufmannEx.Schemas.Event
def given_event(%Event{name: :"command.user.create", payload: payload} = event) do
{:ok, user_info} = Sample.User.create(payload)
Publisher.publish(:"event.user.create", user_info, event.meta)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment