Skip to content

Commit 498db55

Browse files
committed
update: add docstring.
1 parent 01a8ea1 commit 498db55

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

optimizely/event/event_processor.py

+12
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def process(self, user_event):
217217
self.logger.debug('Payload not accepted by the queue. Current size: {}'.format(str(self.event_queue.qsize())))
218218

219219
def _add_to_batch(self, user_event):
220+
""" Method to append received user event to current batch.
221+
Args:
222+
user_event: UserEvent Instance.
223+
"""
220224
if self._should_split(user_event):
221225
self._flush_queue()
222226
self._current_batch = list()
@@ -232,6 +236,14 @@ def _add_to_batch(self, user_event):
232236
self._flush_queue()
233237

234238
def _should_split(self, user_event):
239+
""" Method to check if current event batch should split into two.
240+
Args:
241+
user_event: UserEvent Instance.
242+
Return Value:
243+
- True, if revision number and project_id of last event in current batch do not match received event's
244+
revision number and project id respectively.
245+
- False, otherwise.
246+
"""
235247
if len(self._current_batch) == 0:
236248
return False
237249

0 commit comments

Comments
 (0)