nvflare.apis.shareable module
- class ReservedHeaderKey[source]
Bases:
object- AUDIT_EVENT_ID = '__audit_event_id__'
- CONTENT_TYPE = '__content_type__'
- COOKIE_JAR = '__cookie_jar__'
- ERROR = '__error__'
- HEADERS = '__headers__'
- MSG_ROOT_ID = '__msg_root_id__'
- MSG_ROOT_TTL = '__msg_root_ttl__'
- PASS_THROUGH = '__pass_through__'
- PEER_CTX = '__peer_ctx__'
- PEER_PROPS = '__peer_props__'
- RC = '__rc__'
- REPLY_IS_LATE = '__reply_is_late__'
- TASK_ID = '__task_id__'
- TASK_NAME = '__task_name__'
- TASK_OPERATOR = '__task_operator__'
- TOPIC = '__topic__'
- WORKFLOW = '__workflow__'
- class Shareable(data: dict | None = None)[source]
Bases:
dictThe information communicated between server and client.
Shareable is just a dict that can have any keys and values, defined by developers and users. It is recommended that keys are strings. Values must be serializable.
Init the Shareable.
- add_cookie(name: str, data)[source]
Add a cookie that is to be sent to the client and echoed back in response.
This method is intended to be called by the Server side.
- Parameters:
name – the name of the cookie
data – the data of the cookie, which must be serializable