fiftyone.core.session.client#

Session server-sent events client.

Copyright 2017-2025, Voxel51, Inc.

Classes:

Client(address, auto, port, remote, start_time)

class fiftyone.core.session.client.Client(address: str, auto: bool, port: int, remote: bool, start_time: float)#

Bases: object

Attributes:

address

auto

port

remote

start_time

origin

The origin of the server

is_open

Whether the client is connected

Methods:

open(state)

Open the client connection

close()

Close the client connection

send_event(event)

Sends an event to the server

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

address: str#
auto: bool#
port: int#
remote: bool#
start_time: float#
property origin: str#

The origin of the server

property is_open: str#

Whether the client is connected

open(state: StateDescription) None#

Open the client connection

Arg:

state: the initial state description

close()#

Close the client connection

send_event(event: CaptureNotebookCell | CloseSession | DeactivateNotebookCell | ReactivateNotebookCell | SelectSamples | SelectLabels | SetColorScheme | SetGroupSlice | SetSample | SetSpaces | StateUpdate | SetFieldVisibilityStage) 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