Interface WriteStream<T>
- All Superinterfaces:
MutinyDelegate,StreamBase
- All Known Subinterfaces:
WebSocketBase
- All Known Implementing Classes:
AmqpSender,AsyncFile,ClientWebSocket,HttpClientRequest,HttpServerResponse,KafkaProducer,NetSocket,ServerWebSocket,SockJSSocket,WebSocket
Any class that implements this interface can be used by a Pipe to pipe data from a ReadStream
to it.
original non Mutiny-ified interface using Vert.x codegen.-
Method Summary
Modifier and TypeMethodDescriptiondrainHandler(Runnable handler) io.smallrye.mutiny.Uni<Void>end()Same asend()but with anhandlercalled when the operation completesio.smallrye.mutiny.Uni<Void>Same as but with anhandlercalled when the operation completesBlocking variant ofend().endAndAwait(T data) Blocking variant ofend(T).voidVariant ofend()that ignores the result of the operation.voidendAndForget(T data) Variant ofend(T)that ignores the result of the operation.exceptionHandler(Consumer<Throwable> handler) io.vertx.core.streams.WriteStreamstatic <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) setWriteQueueMaxSize(int maxSize) io.smallrye.mutiny.Uni<Void>Same as but with anhandlercalled when the operation completeswriteAndAwait(T data) Blocking variant ofwrite(T).voidwriteAndForget(T data) Variant ofwrite(T)that ignores the result of the operation.boolean
-
Method Details
-
getDelegate
io.vertx.core.streams.WriteStream getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate used by this Mutiny object of generated type
-
exceptionHandler
- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
-
write
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
Blocking variant ofwrite(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
Variant ofwrite(T)that ignores the result of the operation.This method subscribes on the result of
write(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromwrite(T)but you don't need to compose it with other operations.- Parameters:
data-
-
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
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
Blocking variant ofend(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
Variant ofend(T)that ignores the result of the operation.This method subscribes on the result of
end(T), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromend(T)but you don't need to compose it with other operations.- Parameters:
data-
-
setWriteQueueMaxSize
- 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
- Parameters:
handler- the handler- Returns:
-
newInstance
-
newInstance
static <T> WriteStream<T> newInstance(io.vertx.core.streams.WriteStream arg, TypeArg<T> __typeArg_T)
-