Skip to content

Commit

Permalink
updating documentation of gather routine's new variable return formats
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Mar 19, 2024
1 parent 0aa63d1 commit 735ff80
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/source/Explanation/SarraPluginDev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,17 @@ for detailed information about call signatures and return values, etc...
| | permanent name. |
| | |
| | return the new name for the downloaded/sent file. |
| | |
+---------------------+----------------------------------------------------+
| download(self,msg) | replace built-in downloader return true on success |
| | takes message as argument. |
+---------------------+----------------------------------------------------+
| gather(self) | gather messages from a source, returns a list of |
| | messages. |
| | can also return a tuple where the first element |
| | is a boolean flag keep_going indicating whether |
| | to stop gather processing. |
| | |
+---------------------+----------------------------------------------------+
| | Called every housekeeping interval (minutes) |
| | used to clean cache, check for occasional issues. |
Expand Down
6 changes: 5 additions & 1 deletion docs/source/How2Guides/FlowCallbacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ Other entry_points, extracted from sarracenia/flowcb/__init__.py ::


def gather(self):
Task: gather notification messages from a source... return a list of notification messages.
Task: gather notification messages from a source... return either:
* a list of notification messages, or
* a tuple, (bool:keep_going, list of messages)
* to curtail further gathers in this cycle.
return []

def metrics_report(self) -> dict:
Expand Down
2 changes: 2 additions & 0 deletions docs/source/fr/CommentFaire/FlowCallbacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ Autres entry_points, extraits de sarracenia/flowcb/__init__.py ::

def gather(self):
Task: gather notification messages from a source... return a list of notification messages.
can also return tuple (keep_going, new_messages) where keep_going is a flag
that when False stops processing of further gather routines.
return []

"""
Expand Down
4 changes: 4 additions & 0 deletions docs/source/fr/Explication/SarraPluginDev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ pour des informations détaillées sur les signatures d’appel et les valeurs d
+---------------------+----------------------------------------------------+
| gather(self) | Rassembler les messages a la source, retourne une |
| | une liste de messages. |
| | on peut également retourner un tuple dont le |
| | première élément est une valeur booléen keep_going |
| | qui peut arreter l´execution des gather. |
| | |
+---------------------+----------------------------------------------------+
| | Appelé à chaque intervalle housekeeping (minutes). |
| | utilisé pour nettoyer le cache, vérifier les |
Expand Down

0 comments on commit 735ff80

Please sign in to comment.