trait ForeverSelectorBuilder extends SelectorBuilder[Unit]
Builder for 'forever' selector. Can be obtained as gopherApi.select.forever
.
- Alphabetic
- By Inheritance
- ForeverSelectorBuilder
- SelectorBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
timeout = FiniteDuration
- Definition Classes
- SelectorBuilder
Abstract Value Members
-
abstract
def
api: GopherAPI
- Definition Classes
- SelectorBuilder
Concrete 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
-
macro
def
apply(f: PartialFunction[Any, Unit]): Future[Unit]
provide syntax for running select loop as async operation.
provide syntax for running select loop as async operation.
val receiver = gopherApi.select.forever{ case x: channel.read => Console.println(s"received:$x") }
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
implicit
def
ec: ExecutionContext
- Definition Classes
- SelectorBuilder
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
macro
def
foreach(f: (Any) ⇒ Unit): Unit
provide syntax for running select loop inside go (or async) block example of usage:
provide syntax for running select loop inside go (or async) block example of usage:
go { ..... for(s <- gopherApi.select.forever) s match { case x: ch1.read => do something with x case q: chq.read => implicitly[FlowTermination[Unit]].doExit(()) case y: ch2.write if (y=expr) => do something with y case _ => do somethig when idle. }
Note, that you can use implicit instance of [FlowTermination[Unit]] to stop loop.
-
def
futureInput[A](f: Future[A]): FutureInput[A]
- Definition Classes
- SelectorBuilder
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
go: Future[Unit]
- Definition Classes
- SelectorBuilder
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- macro def idle(body: Unit): ForeverSelectorBuilder
- macro def input[B](f: PartialFunction[Any, B]): Input[B]
- def inputBuilder[B](): InputSelectorBuilder[B]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
macro
def
map[B](f: (Any) ⇒ B): Input[B]
provide syntax for creating output channels.
provide syntax for creating output channels.
val multiplexed = for(s <- gopherApi.select.forever) yield s match { case x: channelA => s"A:${x}" case x: channelB => s"B:${x}" }
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
onIdle(arg: SkipSelectorArgument[Unit]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
-
def
onRead[E](ch: Input[E])(arg: ReadSelectorArgument[E, Unit]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
-
def
onTimeout(t: FiniteDuration)(arg: SkipSelectorArgument[Unit]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
-
def
onWrite[E](ch: Output[E])(arg: WriteSelectorArgument[E, Unit]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
- macro def reading[A](ch: Input[A])(f: (A) ⇒ Unit): ForeverSelectorBuilder
- def readingWithFlowTerminationAsync[A](ch: Input[A], f: (ExecutionContext, FlowTermination[Unit], A) ⇒ Future[Unit]): ForeverSelectorBuilder.this.type
-
def
selectorRun: Future[Unit]
- Definition Classes
- SelectorBuilder
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- macro def timeout(t: FiniteDuration)(f: (FiniteDuration) ⇒ Unit): ForeverSelectorBuilder
-
def
timeoutWithFlowTerminationAsync(t: FiniteDuration, f: (ExecutionContext, FlowTermination[Unit], FiniteDuration) ⇒ Future[Unit]): ForeverSelectorBuilder.this.type
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withIdle(f: (Skip[Unit]) ⇒ Option[Future[Continuated[Unit]]]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
- Annotations
- @inline()
-
def
withReader[B](ch: Input[B], f: (ContRead[B, Unit]) ⇒ Option[(In[B]) ⇒ Future[Continuated[Unit]]]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
- Annotations
- @inline()
-
def
withTimeout(t: FiniteDuration)(f: (Skip[Unit]) ⇒ Option[Future[Continuated[Unit]]]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
- Annotations
- @inline()
-
def
withWriter[B](ch: Output[B], f: (ContWrite[B, Unit]) ⇒ Option[(B, Future[Continuated[Unit]])]): ForeverSelectorBuilder.this.type
- Definition Classes
- SelectorBuilder
- Annotations
- @inline()
- macro def writing[A](ch: Output[A], x: A)(f: (A) ⇒ Unit): ForeverSelectorBuilder
-
def
writingWithFlowTerminationAsync[A](ch: Output[A], x: ⇒ A, f: (ExecutionContext, FlowTermination[Unit], A) ⇒ Future[Unit]): ForeverSelectorBuilder
- Annotations
- @inline()