Skip to content

Commit

Permalink
Update on_success docstring (close #358)
Browse files Browse the repository at this point in the history
PR #359 
* Update `on_success` docstring
  • Loading branch information
Jack-Keene authored Aug 23, 2024
1 parent cb7e434 commit 70b30f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions snowplow_tracker/emitter_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ def __init__(
:param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10.
:type batch_size: int | None
:param on_success: Callback executed after every HTTP request in a flush has status code 200
Gets passed the number of events flushed.
Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads
:type on_success: function | None
:param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200
Gets passed two arguments:
1) The number of events which were successfully sent
2) If method is "post": The unsent data in string form;
If method is "get": An array of dictionaries corresponding to the unsent events' payloads
2) An array of dictionaries corresponding to the unsent events' payloads
:type on_failure: function | None
:param byte_limit: The size event list after reaching which queued events will be flushed
:type byte_limit: int | None
Expand Down Expand Up @@ -105,8 +104,7 @@ def on_failure(self) -> Optional[FailureCallback]:
Callback executed if at least one HTTP request in a flush has status code other than 200
Gets passed two arguments:
1) The number of events which were successfully sent
2) If method is "post": The unsent data in string form;
If method is "get": An array of dictionaries corresponding to the unsent events' payloads
2) An array of dictionaries corresponding to the unsent events' payloads
"""
return self._on_failure

Expand Down
10 changes: 4 additions & 6 deletions snowplow_tracker/emitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@ def __init__(
:param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10.
:type batch_size: int | None
:param on_success: Callback executed after every HTTP request in a flush has status code 200
Gets passed the number of events flushed.
Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads
:type on_success: function | None
:param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200
Gets passed two arguments:
1) The number of events which were successfully sent
2) If method is "post": The unsent data in string form;
If method is "get": An array of dictionaries corresponding to the unsent events' payloads
2) An array of dictionaries corresponding to the unsent events' payloads
:type on_failure: function | None
:param byte_limit: The size event list after reaching which queued events will be flushed
:type byte_limit: int | None
Expand Down Expand Up @@ -463,13 +462,12 @@ def __init__(
:param batch_size: The maximum number of queued events before the buffer is flushed. Default is 10.
:type batch_size: int | None
:param on_success: Callback executed after every HTTP request in a flush has status code 200
Gets passed the number of events flushed.
Gets passed one argument, an array of dictionaries corresponding to the sent events' payloads
:type on_success: function | None
:param on_failure: Callback executed if at least one HTTP request in a flush has status code other than 200
Gets passed two arguments:
1) The number of events which were successfully sent
2) If method is "post": The unsent data in string form;
If method is "get": An array of dictionaries corresponding to the unsent events' payloads
2) An array of dictionaries corresponding to the unsent events' payloads
:type on_failure: function | None
:param thread_count: Number of worker threads to use for HTTP requests
:type thread_count: int
Expand Down

0 comments on commit 70b30f9

Please sign in to comment.