fiftyone.core.session.client¶
Session server-sent events client.
Classes:
|
-
class
fiftyone.core.session.client.
Client
(address: str, auto: bool, desktop: bool, port: int, remote: bool, start_time: float)¶ Bases:
object
Methods:
add_event_listener
(event_name, listener)Adds an event listener callback for the provided event name.
close
()Close the client connection
open
(state)Open the client connection
remove_event_listener
(event_name, listener)Removes an event listener callback for the provided event name if it has been registered
send_event
(event)Sends an event to the server
Attributes:
Whether the client is connected
The origin of the server
-
address
: str = None¶
-
auto
: bool = None¶
-
desktop
: bool = None¶
-
port
: int = None¶
-
remote
: bool = None¶
-
start_time
: float = None¶
-
property
origin
¶ The origin of the server
-
property
is_open
¶ Whether the client is connected
-
open
(state: fiftyone.core.state.StateDescription) → None¶ Open the client connection
- Arg:
state: the initial state description
-
close
()¶ Close the client connection
-
send_event
(event: Union[CaptureNotebookCell, CloseSession, DeactivateNotebookCell, ReactivateNotebookCell, StateUpdate]) → None¶ Sends an event to the server
- Parameters
event – the event
-
add_event_listener
(event_name: str, listener: Callable) → None¶ Adds an event listener callback for the provided event name. Events sent from client and from the server connection will be dispatched to the listener
- Parameters
event_name – the event name
listener – the listener callback
-
remove_event_listener
(event_name: str, listener: Callable) → None¶ Removes an event listener callback for the provided event name if it has been registered
- Parameters
event_name – the event name
listener – the listener callback
-