nvflare.private.aux_runner module¶
- class AuxRunner[source]¶
Bases:
FLComponent
To init the AuxRunner.
- DATA_KEY_BULK = 'bulk_data'¶
- TOPIC_BULK = '__runner.bulk__'¶
- dispatch(topic: str, request: Shareable, fl_ctx: FLContext) Shareable [source]¶
This method is to be called by the Engine when an aux message is received from peer.
NOTE: peer_ctx props must have been set into the PEER_PROPS header of the request by Engine.
- Parameters
topic – message topic
request – request message
fl_ctx – FLContext
Returns: reply message
- handle_event(event_type: str, fl_ctx: FLContext)[source]¶
Handles events.
- Parameters
event_type (str) – event type fired by workflow.
fl_ctx (FLContext) – FLContext information.
- register_aux_message_handler(topic: str, message_handle_func)[source]¶
Register aux message handling function with specified topics.
This method should be called by ServerEngine’s register_aux_message_handler method.
- Parameters
topic – the topic to be handled by the func
message_handle_func – the func to handle the message. Must follow aux_message_handle_func_signature.
Returns: N/A
- Exception is raised when:
a handler is already registered for the topic; bad topic - must be a non-empty string bad message_handle_func - must be callable