nvflare.fuel.utils.pipe.cell_pipe module¶
- class CellPipe(mode: Mode, site_name: str, token: str, root_url: str = '', secure_mode: bool = True, workspace_dir: str = '')[source]¶
Bases:
Pipe
CellPipe is an implementation of Pipe that utilizes the Cell from NVFlare’s foundation layer (f3) to do the communication.
The constructor of the CellPipe.
- Parameters:
mode – passive or active mode
site_name (str) – name of the FLARE site
token (str) – unique id to guarantee the uniqueness of cell’s FQCN.
root_url (str) – the root url of the cellnet that the pipe’s cell will join
secure_mode (bool) – whether connection to the root is secure (TLS)
workspace_dir (str) – the directory that contains startup for joining the cellnet. Required only in secure_mode
- export(export_mode: str) Tuple[str, dict] [source]¶
Exports attributes.
- Parameters:
export_mode (str) – export to peer (ExportMode.PEER) or to self (ExportMode.SELF).
- Returns:
A tuple of (export section name, arguments to be exported)
- get_last_peer_active_time()[source]¶
Get the last time that the peer is known to be active
Returns: the last time that the peer is known to be active; or 0 if this info is not available
- receive(timeout=None) None | Message [source]¶
Try to receive message from peer.
- Parameters:
timeout – how long (number of seconds) to try If not specified, return right away.
- Returns:
the message received; or None if no message