Skip to content

Commit

Permalink
add execution order for eval func
Browse files Browse the repository at this point in the history
  • Loading branch information
panh99 committed Feb 26, 2025
1 parent deca148 commit e104d40
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions framework/docs/source/how-to-use-built-in-mods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Use Built-in Mods

.. note::

This tutorial covers preview features. The functionality and interfaces may
change in future versions.
This tutorial covers preview features. The functionality and interfaces may change
in future versions.

In this tutorial, we will learn how to utilize built-in mods to augment the behavior of
a ``ClientApp``. Mods (sometimes also called Modifiers) allow us to perform operations
Expand Down Expand Up @@ -145,7 +145,12 @@ Assuming the following registration:
def train(msg, ctx):
return msg.create_reply(fl.common.RecordSet())
The execution order would be:
@app.evaluate()
def evaluate(msg, ctx):
return msg.create_reply(fl.common.RecordSet())
The execution order for an incoming **train** message is as follows:

1. ``example_mod_1`` (before handling)
2. ``example_mod_2`` (before handling)
Expand All @@ -157,6 +162,14 @@ The execution order would be:
8. ``example_mod_2`` (after handling)
9. ``example_mod_1`` (after handling)

The execution order for an incoming **evaluate** message is as follows:

1. ``example_mod_1`` (before handling)
2. ``example_mod_2`` (before handling)
3. ``evaluate`` (handling message)
4. ``example_mod_2`` (after handling)
5. ``example_mod_1`` (after handling)

Conclusion
----------

Expand Down

0 comments on commit e104d40

Please sign in to comment.