Package codes.grow.packages.loki
Class LokiTail
java.lang.Object
codes.grow.packages.loki.LokiTail
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionvoidclose()Same asstop().closed()Returns a future that completes once the socket is closed (afterstop()or when the server closes it).longReturns the number of entries the server reported as dropped.booleanisOpen()Returns whether the stream is still open.voidstop()Closes the WebSocket with close code 1000.
-
Method Details
-
stop
public void stop()Closes the WebSocket with close code 1000. Idempotent. -
close
public void close()Same asstop().- Specified by:
closein interfaceAutoCloseable
-
closed
Returns a future that completes once the socket is closed (afterstop()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
-