Class LokiTail

java.lang.Object
codes.grow.packages.loki.LokiTail
All Implemented Interfaces:
AutoCloseable

public final class LokiTail extends Object implements AutoCloseable
Handle of an open tail stream (LokiClient.tail(java.lang.String, java.util.function.Consumer<codes.grow.packages.loki.TailFrame>)). Frames are delivered on the WebSocket's thread; callbacks must not block for long. Exceptions thrown by callbacks are ignored.
  • Method Details

    • stop

      public void stop()
      Closes the WebSocket with close code 1000. Idempotent.
    • close

      public void close()
      Same as stop().
      Specified by:
      close in interface AutoCloseable
    • closed

      public CompletableFuture<Void> closed()
      Returns a future that completes once the socket is closed (after stop() or when the server closes it).
      Returns:
      the future
    • isOpen

      public boolean isOpen()
      Returns whether the stream is still open.
      Returns:
      true until stopped or closed by the server
    • droppedCount

      public long droppedCount()
      Returns the number of entries the server reported as dropped.
      Returns:
      dropped entries so far