File tree Expand file tree Collapse file tree
src/main/java/pl/mjaron/tinyloki Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,8 +93,14 @@ public void clear() {
9393
9494 /**
9595 * Provide stream data and clear old logs.
96+ * <p>
97+ * Not thread safe.
98+ * <p>
99+ * For internal use only.
100+ * <p>
101+ * Called internally by {@link JsonLogCollector} in thread managed by {@link IExecutor}.
96102 *
97- * @return JSON-formatted String containing single stream logs from last syncAnd operation or from beginning of time.
103+ * @return JSON String containing single stream logs from last syncAnd operation or from beginning of time.
98104 * Null if this stream is empty.
99105 */
100106 public String flush () {
Original file line number Diff line number Diff line change @@ -489,12 +489,17 @@ protected void internalProcessLogs() throws InterruptedException {
489489 }
490490
491491 /**
492- * Requests the executor (worker thread) to stop ASAP. Not synchronized logs are dropped.
492+ * Requests the executor (worker thread) to stop ASAP.
493+ * <p>
494+ * Buffered but not sent logs are dropped.
495+ * <p>
496+ * <b>Thread safety</b><br/>
497+ * It may be called from any thread.
493498 *
494499 * @return This reference.
495500 * @since 1.0.0
496501 */
497- synchronized public TinyLoki stopAsync () {
502+ public TinyLoki stopAsync () {
498503 executor .stopAsync ();
499504 return this ;
500505 }
You can’t perform that action at this time.
0 commit comments