- class FLContext[source]¶
Init the FLContext.
The FLContext is used to passed data between FL Components. It can be thought of as a dictionary that stores key/value pairs called props (properties).
- Visibility: private props are only visible to local components,
public props are also visible to remote components
- Stickiness: sticky props become available in all future FL Contexts,
non-sticky props will only be available in the current FL Context
- put(key: str, value, private, sticky)[source]¶
Simply put the prop into the fl context without doing sticky property processing :param key: :param value: :param private: :param sticky:
- class FLContextManager(engine=None, identity_name: str = '', job_id: str = '', public_stickers=None, private_stickers=None)[source]¶
FLContextManager manages the creation and updates of FLContext objects for a run.
NOTE: The engine may create a new FLContextManager object for each RUN!
Init the FLContextManager.
engine – the engine that created this FLContextManager object
identity_name (str) – identity name
job_id – the job id
public_stickers – public sticky properties that are copied into or copied from
private_stickers – private sticky properties that are copied into or copied from
- check_sticker(key: str) -> (<class 'bool'>, typing.Any, <class 'int'>)[source]¶
Check whether a sticky prop exists in either the public or private group.
key – the key of the sticker to be checked
Returns: tuple: whether the sticker exists, its value and mask if it exists
- new_context() FLContext [source]¶
Create a new FLContext object.
Sticky properties are copied from the stickers into the new context.
Returns: a FLContext object