Interface RealtimeObject

All Superinterfaces:
ObjectStateChange
All Known Implementing Classes:
RealtimeObject.Unavailable

public interface RealtimeObject extends ObjectStateChange
The RealtimeObject interface is the entry point to the strongly-typed, path-based LiveObjects API on a channel. It exposes the root of the objects graph as a LiveMapPathObject and, via ObjectStateChange, lets callers observe synchronization state transitions for the channel's objects.

Implementations of this interface must be thread-safe as they may be accessed from multiple threads concurrently.

Spec: RTO23

  • Method Details

    • get

      @NotNull @NotNull CompletableFuture<LiveMapPathObject> get()
      Retrieves a LiveMapPathObject rooted at the channel's root LiveMap. The returned object has an empty path and resolves to the root LiveMap; use its navigation methods to address nested values within the objects graph.

      When called without a type variable, we return a default root type which is based on the globally defined interface for the Objects feature. A user can provide an explicit type to set the type structure on this particular channel. This is useful when working with multiple channels with different underlying data structures.

      This operation requires the OBJECT_SUBSCRIBE channel mode. It implicitly attaches the channel if it is not already attached; the returned future completes once the objects synchronization state has transitioned to SYNCED, and completes exceptionally with an AblyException if synchronization fails.

      Spec: RTO23, RTO23f (typed SDKs return a LiveMapPathObject)

      Returns:
      a future that completes with the root LiveMapPathObject for this channel's objects graph.