public class SyncWriterImpl extends WriterImpl implements SyncWriter
id, isReconnecting, isStopped, reconnectCounter| Constructor and Description |
|---|
SyncWriterImpl(TopicRpc topicRpc,
WriterSettings settings,
Executor compressionExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Waits until all current writes will be sent to server and response will be received.
|
void |
init()
Initialize internal threads in the background.
|
InitResult |
initAndWait()
Initialize internal threads and wait for server init response.
|
void |
send(Message message)
Send message.
|
void |
send(Message message,
long timeout,
TimeUnit unit)
Send message.
|
void |
shutdown(long timeout,
TimeUnit unit)
Stops internal threads and makes cleanup in background.
|
flushImpl, getLogger, getStreamName, initImpl, onShutdown, onStreamReconnect, sendImpl, tryToEnqueueonSessionClosed, shutdownImpl, shutdownImplpublic SyncWriterImpl(TopicRpc topicRpc, WriterSettings settings, Executor compressionExecutor)
public void init()
SyncWriterinit in interface SyncWriterpublic InitResult initAndWait()
SyncWriterinitAndWait in interface SyncWriterInitResult containing initialization data like lastSeqNopublic void send(Message message)
SyncWritersend in interface SyncWritermessage - message data to writepublic void send(Message message, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
SyncWriterTimeoutException if message was not put into queuesend in interface SyncWritermessage - message data to writetimeout - timeout to wait until message is punt into sending bufferunit - TimeUnit for timeoutInterruptedExceptionExecutionExceptionTimeoutExceptionpublic void flush()
SyncWriterflush in interface SyncWriterpublic void shutdown(long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
SyncWritershutdown in interface SyncWriterInterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2024. All rights reserved.