Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<PgSubscriber> |
__TYPE_ARG |
Constructor and Description |
---|
PgSubscriber(Object delegate) |
PgSubscriber(PgSubscriber delegate) |
Modifier and Type | Method and Description |
---|---|
PgConnection |
actualConnection() |
PgChannel |
channel(String name)
Return a channel for the given
name . |
void |
close()
Close the subscriber, the retry policy will not be invoked.
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the subscriber, the retry policy will not be invoked.
|
boolean |
closed() |
PgSubscriber |
closeHandler(Handler<Void> handler)
Set an handler called when the subscriber is closed.
|
PgSubscriber |
connect()
Connect the subscriber to Postgres.
|
PgSubscriber |
connect(Handler<AsyncResult<Void>> handler)
Connect the subscriber to Postgres.
|
boolean |
equals(Object o) |
PgSubscriber |
getDelegate() |
int |
hashCode() |
static PgSubscriber |
newInstance(PgSubscriber arg) |
PgSubscriber |
reconnectPolicy(java.util.function.Function<Integer,Long> policy)
Set the reconnect policy that is executed when the subscriber is disconnected.
|
Single<Void> |
rxClose()
Close the subscriber, the retry policy will not be invoked.
|
Single<Void> |
rxConnect()
Connect the subscriber to Postgres.
|
static PgSubscriber |
subscriber(Vertx vertx,
PgConnectOptions options)
Create a subscriber.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<PgSubscriber> __TYPE_ARG
public PgSubscriber(PgSubscriber delegate)
public PgSubscriber(Object delegate)
public PgSubscriber getDelegate()
public static PgSubscriber subscriber(Vertx vertx, PgConnectOptions options)
vertx
- the vertx instanceoptions
- the connect optionspublic PgChannel channel(String name)
name
.name
- the channel name This will be the name of the channel exactly as held by Postgres for sending notifications. Internally this name will be truncated to the Postgres identifier maxiumum length of (NAMEDATALEN = 64) - 1 == 63
characters, and prepared as a quoted identifier without unicode escape sequence support for use in LISTEN/UNLISTEN
commands. Examples of channel names and corresponding NOTIFY
commands: name == "the_channel"
: NOTIFY the_channel, 'msg'
, NOTIFY The_Channel, 'msg'
, or NOTIFY "the_channel", 'msg'
succeed in delivering a message to the created channel name == "The_Channel"
: NOTIFY "The_Channel", 'msg'
, succeeds in delivering a message to the created channel public PgSubscriber connect(Handler<AsyncResult<Void>> handler)
handler
- the handler notified of the connection success or failurepublic PgSubscriber connect()
public Single<Void> rxConnect()
public PgSubscriber reconnectPolicy(java.util.function.Function<Integer,Long> policy)
policy
function is called with the actual
number of retries and returns an amountOfTime
value:
amountOfTime < 0
: the subscriber is closed and there is no retryamountOfTime == 0
: the subscriber retries to connect immediatelyamountOfTime > 0
: the subscriber retries after amountOfTime
millisecondspolicy
- the policy to setpublic PgSubscriber closeHandler(Handler<Void> handler)
handler
- the handlerpublic PgConnection actualConnection()
null
public boolean closed()
public void close(Handler<AsyncResult<Void>> handler)
handler
- public void close()
public Single<Void> rxClose()
public static PgSubscriber newInstance(PgSubscriber arg)
Copyright © 2022 Eclipse. All rights reserved.