Class PgChannel
- All Implemented Interfaces:
MutinyDelegate,ReadStream<String>,StreamBase
LISTEN/UNLISTEN commands.
When paused the channel discards the messages.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
PgChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream
ReadStream.ReadStreamImpl<T>Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImpl -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionendHandler(Runnable endHandler) Set an handler to be called when no more notifications will be received.booleanexceptionHandler(Consumer<Throwable> handler) Inherited fromReadStream#exceptionHandler(Handler)but this one is a no-op.fetch(long amount) Fetch the specifiedamountof elements.io.vertx.pgclient.pubsub.PgChannelGet the delegate instance.Set or unset an handler to be called when a the channel is notified by Postgres.inthashCode()static PgChannelnewInstance(io.vertx.pgclient.pubsub.PgChannel delegate) Creates a new instance of thePgChannel.pause()Pause the channel, all notifications are discarded.pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<String> dst) Pipe thisReadStreamto theWriteStream.voidpipeToAndAwait(WriteStream<String> dst) Pipe thisReadStreamto theWriteStream.pipeToAndForget(WriteStream<String> dst) Pipe thisReadStreamto theWriteStream.resume()Resume the channel.subscribeHandler(Runnable handler) Set an handler called when the the channel get subscribed.io.smallrye.mutiny.Multi<String>toMulti()toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
PgChannel
public PgChannel(io.vertx.pgclient.pubsub.PgChannel delegate) Create a new instance ofPgChanneldelegating to the given (non-null) instance ofPgChannel. -
PgChannel
-
-
Method Details
-
getDelegate
public io.vertx.pgclient.pubsub.PgChannel getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<String>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
pipeTo
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
pipeToin interfaceReadStream<String>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.pgclient.pubsub.PgChannel#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.pgclient.pubsub.PgChannel#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
dst- the destination write stream- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.pgclient.pubsub.PgChannel#pipeTo(WriteStream)
-
subscribeHandler
Set an handler called when the the channel get subscribed.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
handler
Set or unset an handler to be called when a the channel is notified by Postgres.- when the handler is set, the subscriber sends a
LISTENcommand if needed - when the handler is unset, the subscriber sends a
UNLISTENcommand if needed
- Specified by:
handlerin interfaceReadStream<String>- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
- when the handler is set, the subscriber sends a
-
pause
Pause the channel, all notifications are discarded.- Specified by:
pausein interfaceReadStream<String>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Resume the channel.- Specified by:
resumein interfaceReadStream<String>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Set an handler to be called when no more notifications will be received.- Specified by:
endHandlerin interfaceReadStream<String>- Parameters:
endHandler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
Inherited fromReadStream#exceptionHandler(Handler)but this one is a no-op.- Specified by:
exceptionHandlerin interfaceReadStream<String>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Fetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<String>- Returns:
- a reference to this, so the API can be used fluently
- Throws:
when- the amount is a negative value
-
pipe
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<String>- Returns:
- a pipe
-
newInstance
Creates a new instance of thePgChannel. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
-
toBlockingIterable
-
toBlockingStream
-