Package io.vertx.pgclient.pubsub
Interface PgChannel
-
- All Superinterfaces:
ReadStream<String>,StreamBase
public interface PgChannel extends 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PgChannelendHandler(Handler<Void> endHandler)Set an handler to be called when no more notifications will be received.PgChannelexceptionHandler(Handler<Throwable> handler)Set an exception handler on the read stream.PgChannelhandler(Handler<String> handler)Set or unset an handler to be called when a the channel is notified by Postgres.PgChannelpause()Pause the channel, all notifications are discarded.PgChannelresume()Resume the channel.PgChannelsubscribeHandler(Handler<Void> handler)Set an handler called when the the channel get subscribed.-
Methods inherited from interface io.vertx.core.streams.ReadStream
blockingStream, collect, fetch, pipe, pipeTo
-
-
-
-
Method Detail
-
subscribeHandler
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
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
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
PgChannel resume()
Resume the channel.- Specified by:
resumein interfaceReadStream<String>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
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
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
-
-