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,
SendSettings sendSettings)
Send message.
|
void |
send(Message message,
SendSettings sendSettings,
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, tryToEnqueuegenerateRandomId, onSessionClosed, shutdownImpl, shutdownImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsend, sendpublic 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, SendSettings sendSettings)
SyncWritersend in interface SyncWritermessage - message data to writesendSettings - send settingspublic void send(Message message, SendSettings sendSettings, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
SyncWriterTimeoutException if message was not put into queuesend in interface SyncWritermessage - message data to writesendSettings - send settingstimeout - 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 © 2025. All rights reserved.