-
Notifications
You must be signed in to change notification settings - Fork 59
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
Break down incoming events to publish separately #1472
Conversation
apps/omg_child_chain/lib/omg_child_chain/datadog_event/contract_event_consumer.ex
Show resolved
Hide resolved
topic_name = self() |> :erlang.pid_to_list() |> to_string() | ||
sig = "#{topic_name}(bytes32)" | ||
data = [%{event_signature: sig}, %{event_signature: sig}] | ||
{:root_chain, topic_name} |> OMG.Bus.Event.new(:data, data) |> OMG.Bus.direct_local_broadcast() | ||
|
||
assert_receive {:event, _, _} | ||
Enum.each(data, fn _ -> | ||
assert_receive {:event, _, _} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that it expect 2 events, should we check that they're indeed the two events, and not one event reported twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, i'm taking the message into equation then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
📋 Partly #1426
Overview
This enables to break down and send separate events to Datadog, when events consumed from Ethereum event listeners come in bulk
Changes
OMG.Watcher.DatadogEvent.ContractEventConsumer
and the Childchain sibling to iterate and send received events individuallyTesting