public final class ThreadLocalAppender extends Object
| Modifier and Type | Method and Description |
|---|---|
static ExcerptAppender |
acquireThreadLocalAppender(ChronicleQueue queue)
Returns a ExcerptAppender for the given ChronicleQueue that is local to the current Thread.
|
public static ExcerptAppender acquireThreadLocalAppender(ChronicleQueue queue)
An Appender can be used to store new excerpts sequentially to the queue.
An Appender is NOT thread-safe and, in addition to that, confined to be used by the creating thread only.. Sharing an Appender across threads is unsafe and will inevitably lead to errors and unspecified behaviour.
This method returns a ThreadLocal appender, so does not produce any garbage, hence it's safe to simply call
this method every time an appender is needed.
IllegalArgumentException - if the queue it is passed is not an instance of SingleChronicleQueueCopyright © 2024. All rights reserved.