You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stop-flag is used to signal the operator (from the outside caller) that it should terminate gracefully.
The ready-flag is used to signal the outside caller (from the operator) that the operator has initialised and is ready to work.
This bi-directional communication slightly simplifies the orchestration of the operators when they are embedded into arbitrary applications (i.e. not called via kopf run). This could be also done by cancelling the task of the operator, but that would require few extra lines to operate it (checking for the cross-thread flag and finishing the asyncio task), which are already present inside of the operator coroutines — so why not utilise that?
An example is added to demonstrate how an embedded operator can look like.
Also, the docs were fixed for the embedded operator.
Types of Changes
New feature (non-breaking change which adds functionality)
Documentation / non-code
The text was updated successfully, but these errors were encountered:
Add stop/ready flags to the operator coroutines, and add an example for the embedded operator, which uses these flags.
Description
The stop-flag is used to signal the operator (from the outside caller) that it should terminate gracefully.
The ready-flag is used to signal the outside caller (from the operator) that the operator has initialised and is ready to work.
This bi-directional communication slightly simplifies the orchestration of the operators when they are embedded into arbitrary applications (i.e. not called via
kopf run
). This could be also done by cancelling the task of the operator, but that would require few extra lines to operate it (checking for the cross-thread flag and finishing the asyncio task), which are already present inside of the operator coroutines — so why not utilise that?An example is added to demonstrate how an embedded operator can look like.
Also, the docs were fixed for the embedded operator.
Types of Changes
The text was updated successfully, but these errors were encountered: