Interface WriteStream<T>
-
- All Superinterfaces:
StreamBase
- All Known Subinterfaces:
WebSocketBase
- All Known Implementing Classes:
AmqpSender,AsyncFile,HttpClientRequest,HttpServerResponse,KafkaProducer,NetSocket,ServerWebSocket,SockJSSocket,WebSocket
public interface WriteStream<T> extends StreamBase
Represents a stream of data that can be written to.Any class that implements this interface can be used by a
NOTE: This class has been automatically generated from thePipeto pipe data from aReadStreamto it.originalnon Mutiny-ified interface using Vert.x codegen.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteStream<T>drainHandler(Runnable handler)io.smallrye.mutiny.Uni<Void>end()Same asend()but with anhandlercalled when the operation completesio.smallrye.mutiny.Uni<Void>end(T data)Same as but with anhandlercalled when the operation completesVoidendAndAwait()Blocking variant ofend().VoidendAndAwait(T data)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(T).voidendAndForget()Variant ofend()that ignores the result of the operation.voidendAndForget(T data)Variant ofio.vertx.mutiny.core.streams.WriteStream#end(T)that ignores the result of the operation.WriteStream<T>exceptionHandler(Consumer<Throwable> handler)io.vertx.core.streams.WriteStreamgetDelegate()static <T> WriteStream<T>newInstance(io.vertx.core.streams.WriteStream arg)static <T> WriteStream<T>newInstance(io.vertx.core.streams.WriteStream arg, TypeArg<T> __typeArg_T)WriteStream<T>setWriteQueueMaxSize(int maxSize)io.smallrye.mutiny.Uni<Void>write(T data)Same as but with anhandlercalled when the operation completesVoidwriteAndAwait(T data)Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(T).voidwriteAndForget(T data)Variant ofio.vertx.mutiny.core.streams.WriteStream#write(T)that ignores the result of the operation.booleanwriteQueueFull()
-
-
-
Method Detail
-
getDelegate
io.vertx.core.streams.WriteStream getDelegate()
- Specified by:
getDelegatein interfaceStreamBase
-
exceptionHandler
WriteStream<T> exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
-
write
@CheckReturnValue io.smallrye.mutiny.Uni<Void> write(T data)
Same as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
data-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Void writeAndAwait(T data)
Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#write(T).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
data-- Returns:
- the Void instance produced by the operation.
-
writeAndForget
void writeAndForget(T data)
Variant ofio.vertx.mutiny.core.streams.WriteStream#write(T)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#write(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#write(T)but you don't need to compose it with other operations.- Parameters:
data-
-
end
@CheckReturnValue io.smallrye.mutiny.Uni<Void> end()
Same asend()but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Void endAndAwait()
Blocking variant ofend().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
endAndForget
void endAndForget()
-
end
@CheckReturnValue io.smallrye.mutiny.Uni<Void> end(T data)
Same as but with anhandlercalled when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
data-- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Void endAndAwait(T data)
Blocking variant ofio.vertx.mutiny.core.streams.WriteStream#end(T).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
data-- Returns:
- the Void instance produced by the operation.
-
endAndForget
void endAndForget(T data)
Variant ofio.vertx.mutiny.core.streams.WriteStream#end(T)that ignores the result of the operation.This method subscribes on the result of
io.vertx.mutiny.core.streams.WriteStream#end(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromio.vertx.mutiny.core.streams.WriteStream#end(T)but you don't need to compose it with other operations.- Parameters:
data-
-
setWriteQueueMaxSize
WriteStream<T> setWriteQueueMaxSize(int maxSize)
- Parameters:
maxSize- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
writeQueueFull
boolean writeQueueFull()
- Returns:
trueif write queue is full
-
drainHandler
WriteStream<T> drainHandler(Runnable handler)
- Parameters:
handler- the handler- Returns:
-
newInstance
static <T> WriteStream<T> newInstance(io.vertx.core.streams.WriteStream arg)
-
newInstance
static <T> WriteStream<T> newInstance(io.vertx.core.streams.WriteStream arg, TypeArg<T> __typeArg_T)
-
-