nvflare.app_common.executors.ipc_exchanger module

class IPCExchanger(send_task_timeout=5.0, agent_ready_timeout=60.0, agent_heartbeat_timeout=600.0, agent_is_child=False)[source]

Bases: Executor

Constructor of IPCExchanger

Parameters:
  • send_task_timeout – when sending task to Agent, how long to wait for response

  • agent_ready_timeout – how long to wait for the agent to be connected

  • agent_heartbeat_timeout – max time allowed to miss heartbeats from the agent

  • agent_is_child – whether the agent will be a child cell.

execute(task_name: str, shareable: Shareable, fl_ctx: FLContext, abort_signal: Signal) Shareable[source]

Executes a task.

Parameters:
  • task_name (str) – task name.

  • shareable (Shareable) – input shareable.

  • fl_ctx (FLContext) – fl context.

  • abort_signal (Signal) – signal to check during execution to determine whether this task is aborted.

Returns:

An output shareable.

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.