Packages

class PgSubscriber extends AnyRef

A class for managing subscriptions using LISTEN/UNLISTEN to Postgres channels.

The subscriber manages a single connection to Postgres.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PgSubscriber
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PgSubscriber(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def actualConnection(): PgConnection

    returns

    the actual connection to Postgres, it might be null

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asJava: AnyRef
  7. def channel(name: String): PgChannel

    Return a channel for the given name.

    Return a channel for the given name. * @param 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:

    • when 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
    • when name == "The_Channel": NOTIFY "The_Channel", 'msg', succeeds in delivering a message to the created channel -
    returns

    the channel

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def close(): Unit

    Close the subscriber, the retry policy will not be invoked.

  10. def closeHandler(handler: Handler[Unit]): PgSubscriber

    Set an handler called when the subscriber is closed.

    Set an handler called when the subscriber is closed. * @param handler the handler

    returns

    a reference to this, so the API can be used fluently

  11. def closed(): Boolean

    returns

    whether the subscriber is closed

  12. def connect(handler: Handler[AsyncResult[Unit]]): PgSubscriber

    Connect the subscriber to Postgres.

    Connect the subscriber to Postgres. * @param handler the handler notified of the connection success or failure

    returns

    a reference to this, so the API can be used fluently

  13. def connectFuture(): Future[Unit]

    Like connect but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def reconnectPolicy(policy: (Int) ⇒ Long): PgSubscriber

    Set the reconnect policy that is executed when the subscriber is disconnected.

    Set the reconnect policy that is executed when the subscriber is disconnected.

    When the subscriber is disconnected, the policy function is called with the actual number of retries and returns an amountOfTime value:

    • when amountOfTime < 0: the subscriber is closed and there is no retry
    • when amountOfTime == 0: the subscriber retries to connect immediately
    • when amountOfTime > 0: the subscriber retries after amountOfTime milliseconds

    The default policy does not perform any retries. * @param policy the policy to set

    returns

    a reference to this, so the API can be used fluently

  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toString(): String
    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped