nvflare.private.aux_runner module

class AuxRunner(engine)[source]

Bases: FLComponent

To init the AuxRunner.

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

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

send_aux_request(targets: list, topic: str, request: Shareable, timeout: float, fl_ctx: FLContext, bulk_send: bool = False, optional: bool = False, secure: bool = False) dict[source]