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.
remove_event_listener
(event_name, listener)Removes an event listener callback for the provided event name if it has been registered
run
(state)Runs the client subscription in a background thread
send_event
(event)Sends an event to the server
Attributes:
The origin of the server
-
address
: str = None¶
-
auto
: bool = None¶
-
desktop
: bool = None¶
-
port
: int = None¶
-
remote
: bool = None¶
-
start_time
: float = None¶
-
run
(state: fiftyone.core.state.StateDescription) → None¶ Runs the client subscription in a background thread
- Arg:
state: the initial state description
-
property
origin
¶ The origin of the server
-
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
-