-
Notifications
You must be signed in to change notification settings - Fork 28
feat(notification-center): Added LogEvent notification and integration. #197
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
Conversation
NotificationCenter::NOTIFICATION_TYPES[:TRACK], | ||
event_key, user_id, attributes, event_tags, log_event | ||
) | ||
if @notification_center.notification_count(NotificationCenter::NOTIFICATION_TYPES[:TRACK]).positive? |
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.
What do we gain by checking notification count, as opposed to just sending notifications regardless of count?
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.
This validates that the listener has already been added before sending the notification.
Please view java-sdk as a reference: https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/Optimizely.java#L304
@@ -36,10 +36,11 @@ class BatchEventProcessor < EventProcessor | |||
|
|||
def initialize( | |||
event_queue: SizedQueue.new(DEFAULT_QUEUE_CAPACITY), | |||
event_dispatcher:, | |||
event_dispatcher: Optimizely::EventDispatcher.new, |
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.
Why are we adding a default value here?
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.
This is not related to LogEvent, therefore moved to PR: #200
@@ -144,6 +151,16 @@ def run | |||
|
|||
add_to_batch(item) if item.is_a? Optimizely::UserEvent | |||
end | |||
rescue SignalException |
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.
This seems like an important change, but it isn't discussed in the summary. Could you explain this change? If this isn't related to LogEvent notification, then I think it should be in its own separate PR.
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.
Moved changes into PR: #200.
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.
LGTM
Summary
LogEvent
notification innotification_center.rb
.batch_event_dispatcher.rb
andforwarding_event_processor.rb
.notification_count
innotification_center.rb
and integrated intoOptimizely
fornotification types
ACTIVATE and TRACK.Test plan
LogEvent
innotification_center_spec.rb
,batch_event_dispatcher_spec.rb
andforwarding_event_processor_spec.rb
.Optimizely's
unit tests forLogEvent
andnotification_count
.