Package 

Class AblyRealtime

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public class AblyRealtime
    extends AblyRest
                        

    A client that extends the functionality of the AblyRest and provides additional realtime-specific features. This class implements AutoCloseable so you can use it in try-with-resources constructs and have the JDK close it for you.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface AblyRealtime.Channels

      A collection of Channels associated with this Ably Realtime instance.

    • Method Summary

      Modifier and Type Method Description
      void connect() Calls connect and causes the connection to open,entering the connecting state.
      void close() Calls close and causes the connection to close, entering the closing state.
      • Methods inherited from class io.ably.lib.rest.AblyRest

        device, setAndroidContext
      • Methods inherited from class io.ably.lib.rest.AblyBase

        publishBatch, publishBatch, publishBatchAsync, publishBatchAsync, request, requestAsync, stats, statsAsync, time, timeAsync
      • Methods inherited from class java.lang.AutoCloseable

        close
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AblyRealtime

        AblyRealtime(String key)
        Constructs a Realtime client object using an Ably API key or token string.
        Parameters:
        key - The Ably API key or token string used to validate the client.
    • Method Detail

      • connect

         void connect()

        Calls connect and causes the connection to open,entering the connecting state. Explicitly calling connect() is unnecessaryunless the autoConnect property is disabled.

        Spec: RTN11

      • close

         void close()

        Calls close and causes the connection to close, entering the closing state.Once closed, the library will not attempt to re-establish the connectionwithout an explicit call to connect.

        Spec: RTN12