From 498db556b7bae8a404ab72a5f1dabb9020b47945 Mon Sep 17 00:00:00 2001 From: MariamJamal32 Date: Wed, 25 Sep 2019 09:36:09 +0500 Subject: [PATCH] update: add docstring. --- optimizely/event/event_processor.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/optimizely/event/event_processor.py b/optimizely/event/event_processor.py index a9996d23..db81dbc6 100644 --- a/optimizely/event/event_processor.py +++ b/optimizely/event/event_processor.py @@ -217,6 +217,10 @@ def process(self, user_event): self.logger.debug('Payload not accepted by the queue. Current size: {}'.format(str(self.event_queue.qsize()))) def _add_to_batch(self, user_event): + """ Method to append received user event to current batch. + Args: + user_event: UserEvent Instance. + """ if self._should_split(user_event): self._flush_queue() self._current_batch = list() @@ -232,6 +236,14 @@ def _add_to_batch(self, user_event): self._flush_queue() def _should_split(self, user_event): + """ Method to check if current event batch should split into two. + Args: + user_event: UserEvent Instance. + Return Value: + - True, if revision number and project_id of last event in current batch do not match received event's + revision number and project id respectively. + - False, otherwise. + """ if len(self._current_batch) == 0: return False