Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transient subscription event mapping function #108

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

slashdotdash
Copy link
Member

You can provide an event mapping function that maps each EventStore.RecordedEvent before sending it to the subscriber:

EventStore.subscribe(stream_uuid, mapper: fn
  %EventStore.RecordedEvent{data: data} -> data
end)

# receive first batch of mapped event data
receive do
  {:events, event_data} ->
    IO.puts "Received event data: " <> inspect(event_data)
end

@slashdotdash slashdotdash force-pushed the feature/transient-subscription-mapper branch from eaf1775 to 5de99ce Compare February 23, 2018 15:02
@slashdotdash slashdotdash merged commit 0715ede into master Feb 23, 2018
@slashdotdash slashdotdash deleted the feature/transient-subscription-mapper branch February 23, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant