Class PgChannel
- java.lang.Object
-
- io.vertx.reactivex.pgclient.pubsub.PgChannel
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate,ReadStream<String>,StreamBase
public class PgChannel extends Object implements io.vertx.lang.rx.RxDelegate, ReadStream<String>
A channel to Postgres that tracks the subscription to a given Postgres channel using theLISTEN/UNLISTENcommands. When paused the channel discards the messages.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<PgChannel>__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PgChannelendHandler(Handler<Void> endHandler)Set an handler to be called when no more notifications will be received.booleanequals(Object o)PgChannelexceptionHandler(Handler<Throwable> handler)Set an exception handler on the read stream.ReadStream<String>fetch(long amount)Fetch the specifiedamountof elements.PgChannelgetDelegate()PgChannelhandler(Handler<String> handler)Set or unset an handler to be called when a the channel is notified by Postgres.inthashCode()static PgChannelnewInstance(PgChannel arg)PgChannelpause()Pause the channel, all notifications are discarded.Pipe<String>pipe()Pause this stream and return a to transfer the elements of this stream to a destination .Future<Void>pipeTo(WriteStream<String> dst)Pipe thisReadStreamto theWriteStream.PgChannelresume()Resume the channel.CompletablerxPipeTo(WriteStream<String> dst)Pipe thisReadStreamto theWriteStream.PgChannelsubscribeHandler(Handler<Void> handler)Set an handler called when the the channel get subscribed.Flowable<String>toFlowable()Observable<String>toObservable()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<PgChannel> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public PgChannel getDelegate()
- Specified by:
getDelegatein interfaceReadStream<String>- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate- Specified by:
getDelegatein interfaceStreamBase
-
toObservable
public Observable<String> toObservable()
- Specified by:
toObservablein interfaceReadStream<String>
-
toFlowable
public Flowable<String> toFlowable()
- Specified by:
toFlowablein interfaceReadStream<String>
-
fetch
public ReadStream<String> fetch(long amount)
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>- Parameters:
amount-- Returns:
- a reference to this, so the API can be used fluently
-
pipe
public Pipe<String> pipe()
Pause this stream and return a to transfer the elements of this stream to a destination . The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<String>- Returns:
- a pipe
-
pipeTo
public Future<Void> pipeTo(WriteStream<String> dst)
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
- Specified by:
pipeToin interfaceReadStream<String>- Parameters:
dst- the destination write stream- Returns:
- a future notified when the write stream will be ended with the outcome
-
rxPipeTo
public Completable rxPipeTo(WriteStream<String> dst)
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
- Specified by:
rxPipeToin interfaceReadStream<String>- Parameters:
dst- the destination write stream- Returns:
- a future notified when the write stream will be ended with the outcome
-
subscribeHandler
public PgChannel subscribeHandler(Handler<Void> handler)
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
public PgChannel handler(Handler<String> 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
public PgChannel 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
public PgChannel resume()
Resume the channel.- Specified by:
resumein interfaceReadStream<String>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
public PgChannel endHandler(Handler<Void> 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
public PgChannel exceptionHandler(Handler<Throwable> handler)
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<String>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler- Returns:
- a reference to this, so the API can be used fluently
-
-