nvflare.private.fed.client.admin module

The FedAdmin to communicate with the Admin server.

class FedAdminAgent(client_name, sender: Sender, app_ctx, req_poll_interval=0.5, process_poll_interval=0.1)[source]

Bases: object

FedAdminAgent communicate with the FedAdminServer.

Init the FedAdminAgent.

Parameters
  • client_name – client name

  • sender – Sender object

  • app_ctx – application context

  • req_poll_interval – request polling interval

  • process_poll_interval – process polling interval

register_processor(processor: RequestProcessor)[source]

To register the RequestProcessor.

Parameters

processor – RequestProcessor

shutdown()[source]

To be called by the Client Engine to gracefully shutdown the agent.

start()[source]

To start the FedAdminAgent.

class RequestProcessor[source]

Bases: object

The RequestProcessor is responsible for processing a request.

get_topics() [<class 'str'>][source]

Get topics that this processor will handle.

Returns: list of topics

process(req: Message, app_ctx) Message[source]

Called to process the specified request.

Parameters
  • req – request message

  • app_ctx – application context

Returns: reply message

class Sender[source]

Bases: object

The Sender object integrate the agent with the underline messaging system.

Make sure its methods are exception-proof!

close()[source]

Call to close the sender.

Returns:

retrieve_requests() [<class 'nvflare.private.admin_defs.Message'>][source]

Send the message to retrieve pending requests from the Server.

Returns: list of messages.

send_reply(reply: Message)[source]

Send the reply to the requester.

Parameters

reply – reply message

send_result(message: Message)[source]

Send the processor results to server.

Parameters

message – message