nvflare.apis.impl.seq_relay_manager module

class SequentialRelayTaskManager(task: Task, task_assignment_timeout, task_result_timeout, dynamic_targets: bool)[source]

Bases: TaskManager

Task manager for relay controller on SendOrder.SEQUENTIAL.

Parameters
  • task (Task) – an instance of Task

  • task_assignment_timeout (int) – timeout value on a client requesting its task

  • task_result_timeout (int) – timeout value on reply of one client

  • dynamic_targets (bool) – allow clients to join after this task starts

check_task_exit(task: Task) Tuple[bool, TaskCompletionStatus][source]

Determine whether the task should exit.

Parameters

task (Task) – an instance of Task

Returns

first entry in the tuple means whether to exit the task or not. If it’s True, the task should exit. second entry in the tuple indicates the TaskCompletionStatus.

Return type

Tuple[bool, TaskCompletionStatus]

check_task_result(result: Shareable, client_task: ClientTask, fl_ctx: FLContext)[source]

Check the result received from the client.

See whether the client_task is the last one in the task’s list If not, then it is a late response and ReservedHeaderKey.REPLY_IS_LATE is set to True in result’s header.

Parameters
  • result (Shareable) – an instance of Shareable

  • client_task (ClientTask) – the task processing state of the client

  • fl_ctx (FLContext) – fl context that comes with the task request

check_task_send(client_task: ClientTask, fl_ctx: FLContext) TaskCheckStatus[source]

Determine whether the task should be sent to the client.

Parameters
  • client_task (ClientTask) – the task processing state of the client

  • fl_ctx (FLContext) – fl context that comes with the task request

Returns

NO_BLOCK for not sending the task, BLOCK for waiting, SEND for OK to send

Return type

TaskCheckStatus