Class LiveStream

java.lang.Object
com.surrealdb.LiveStream
All Implemented Interfaces:
AutoCloseable

public class LiveStream extends Object implements AutoCloseable
Blocking iterator over live query notifications. Call next() in a loop and close() when done. Implements AutoCloseable for use in try-with-resources.
  • Method Details

    • next

      public Optional<LiveNotification> next()
      Blocks until the next notification is available, or the stream ends.
      Returns:
      the next notification, or empty if the stream has ended
    • close

      public void close()
      Releases the live query and stops receiving notifications. Idempotent.
      Specified by:
      close in interface AutoCloseable