final class RefPushSession[In, Out] extends PushSession[In, Out]
Proxy PushSession which can update the underlying session.
Thread safety considerations
- receive
is only intended to be called from within the serial executor, which is
a general rule in all PushSession
implementations.
- updateRef
should be called only from within the handle's serial executor. This
is to avoid race conditions between closing the underlying session (which happens
in the serial executor) and replacing it with a new session: if replacing happens
in the same thread, there is no need to worry about broadcasting close events
from the old session to the new one.
- close
and status
are safe to call from any thread.
- Alphabetic
- By Inheritance
- RefPushSession
- PushSession
- Closable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RefPushSession(handle: PushChannelHandle[In, Out], initial: PushSession[In, Out])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(deadline: Time): Future[Unit]
Close the underlying session
Close the underlying session
Calls to this method are bounced through the serial-executor to help alleviate race conditions where the underlying session is replaced concurrently with the underlying session being closed.
- Definition Classes
- RefPushSession → Closable
- def close(after: Duration): Future[Unit]
- Definition Classes
- Closable
- final def close(): Future[Unit]
- Definition Classes
- Closable
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def receive(message: In): Unit
Receive a message, most commonly from the socket.
Receive a message, most commonly from the socket. Received messages are considered owned by the PushSession meaning the session is responsible for cleaning up any associated resources.
- Definition Classes
- RefPushSession → PushSession
- def status: Status
The current availability Status of this PushSession.
The current availability Status of this PushSession.
- Definition Classes
- RefPushSession → PushSession
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updateRef(session: PushSession[In, Out]): Unit
Replaces the current PushSession, directing inbound events to the new session.
Replaces the current PushSession, directing inbound events to the new session.
- Note
It is unsafe to update the reference from outside of serial executor and may result in undefined behavior.
,other than no longer receiving inbound messages, the replaced session is still active and it is the responsibility of the caller to manage the lifecycle of the replaced session.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()