addListener method

void addListener(
  1. ClientListener listener
)

Adds a listener that will receive events from the LightstreamerClient instance.

The same listener can be added to several different LightstreamerClient instances.

Lifecycle A listener can be added at any time. A call to add a listener already present will be ignored.

  • listener An object that will receive the events as documented in the ClientListener interface.

  • See removeListener

Implementation

void addListener(ClientListener listener) {
  if (!_listeners.contains(listener)) {
    _listeners.add(listener);
    scheduleMicrotask(() {
      listener.onListenStart();
    });
  }
}