Package io.ably.lib.objects.state
Interface ObjectsStateChange
- All Known Subinterfaces:
RealtimeObjects
public interface ObjectsStateChange
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface for receiving notifications about Objects synchronization state changes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
off
(ObjectsStateChange.Listener listener) Unsubscribes the specified listener from all synchronization state events.void
offAll()
Unsubscribes all listeners from all synchronization state events.on
(@NotNull ObjectsStateEvent event, ObjectsStateChange.Listener listener) Subscribes to a specific Objects synchronization state event.
-
Method Details
-
on
@NonBlocking ObjectsSubscription on(@NotNull @NotNull ObjectsStateEvent event, @NotNull ObjectsStateChange.Listener listener) Subscribes to a specific Objects synchronization state event.This method registers the provided listener to be notified when the specified synchronization state event occurs. The returned subscription can be used to unsubscribe later when the notifications are no longer needed.
- Parameters:
-
event
- the synchronization state event to subscribe to (SYNCING or SYNCED) -
listener
- the listener that will be called when the event occurs - Returns:
- a subscription object that can be used to unsubscribe from the event
-
off
Unsubscribes the specified listener from all synchronization state events.After calling this method, the provided listener will no longer receive any synchronization state event notifications.
- Parameters:
-
listener
- the listener to unregister from all events
-
offAll
@NonBlocking void offAll()Unsubscribes all listeners from all synchronization state events.After calling this method, no listeners will receive any synchronization state event notifications until new listeners are registered.
-