public static interface FlushStrategy.WriteEventsListener
FlushStrategy
is
applied
.
For each FlushStrategy.WriteEventsListener
returned from FlushStrategy.apply(FlushSender)
, following calls
will be made:
writeStarted()
itemWritten(Object)
writeTerminated()
writeCancelled()
writeTerminated()
or writeCancelled()
writeStarted()
always
happens-before a call to
any other methods.
None of writeStarted()
, itemWritten(Object)
and writeTerminated()
can be called
concurrently with each other but writeCancelled()
can be called concurrently with
itemWritten(Object)
or writeTerminated()
.
Modifier and Type | Method and Description |
---|---|
void |
itemWritten(java.lang.Object written)
For each new
FlushStrategy.WriteEventsListener returned from FlushStrategy.apply(FlushSender) , this method
will be called once after any item is written to the connection. |
void |
writeCancelled()
For each new
FlushStrategy.WriteEventsListener returned from FlushStrategy.apply(FlushSender) , this method
will be called at most once when writes are cancelled. |
void |
writeStarted()
For each new
FlushStrategy.WriteEventsListener returned from FlushStrategy.apply(FlushSender) , this method
will be called at most once before any items are written to the connection. |
void |
writeTerminated()
For each new
FlushStrategy.WriteEventsListener returned from FlushStrategy.apply(FlushSender) , this method
will be called at most once when all other items are written to the connection. |
void writeStarted()
FlushStrategy.WriteEventsListener
returned from FlushStrategy.apply(FlushSender)
, this method
will be called at most once before any items are written to the connection.
This will be followed by zero or more calls to itemWritten(Object)
and at most one call to
writeTerminated()
and writeCancelled()
or both.
void itemWritten(@Nullable java.lang.Object written)
FlushStrategy.WriteEventsListener
returned from FlushStrategy.apply(FlushSender)
, this method
will be called once after any item is written to the connection.
This will be followed by zero or more calls to this method and at most one call to writeTerminated()
and writeCancelled()
or both.
writeCancelled()
can be called concurrently with this method.
written
- Item that was written.void writeTerminated()
FlushStrategy.WriteEventsListener
returned from FlushStrategy.apply(FlushSender)
, this method
will be called at most once when all other items are written to the connection.
writeCancelled()
MAY be called concurrently or after this method.
void writeCancelled()
FlushStrategy.WriteEventsListener
returned from FlushStrategy.apply(FlushSender)
, this method
will be called at most once when writes are cancelled.
itemWritten(Object)
or writeTerminated()
MAY be called concurrently or after this
method.