trait Input[A] extends GopherAPIProvider
Entity, from which we can read objects of type A.
- Self Type
- Input[A]
- Alphabetic
- By Inheritance
- Input
- GopherAPIProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Abstract Value Members
-
abstract
def
api: GopherAPI
instance of gopher API
instance of gopher API
- Definition Classes
- Input → GopherAPIProvider
-
abstract
def
cbread[B](f: (ContRead[A, B]) ⇒ Option[(In[A]) ⇒ Future[Continuated[B]]], ft: FlowTermination[B]): Unit
apply f, when input will be ready and send result to API processor
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
?: A
synonym for read.
-
macro
def
afold[S, B](s0: S)(f: (S, A) ⇒ S): Future[S]
async incarnation of fold.
async incarnation of fold. Fold return future, which successed when channel is closed. Operations withing fold applyed on result on each other, starting with s0.
val fsum = ch.afold(0){ (s, n) => s+n }
Here in fsum will be future with value: sum of all elements in channel until one has been closed.
- def afoldAsync[S, B](s0: S)(f: (S, A) ⇒ Future[S])(implicit ec: ExecutionContext): Future[S]
- def afoldSync[S, B](s0: S)(f: (S, A) ⇒ S): Future[S]
- macro def aforeach(f: (A) ⇒ Unit): Future[Unit]
- def amap[B](g: (A) ⇒ Future[B]): Input[B]
-
def
append(other: Input[A]): Input[A]
when the first channel is exhaused, read from second.
-
def
aread: Future[A]
async version of read.
async version of read. Immediatly return future, which will contains result of read or failur with StreamClosedException in case of stream is closed.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def async: AnyRef { ... /* 3 definitions in type refinement */ }
-
def
atake(n: Int): Future[IndexedSeq[A]]
return feature which contains sequence from first
n
elements. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
lazy val
closeless: Input[A]
- returns
Input without close event: i.e. reading from closeless channel after channel close will wait forever instead throwing CloseChannelException
-
def
dup(): (Input[A], Input[A])
duplicate input
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def filter(p: (A) ⇒ Boolean): Input[A]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def flatFold(fun: (Input[A], A) ⇒ Input[A]): Input[A]
- def flatMap[B](g: (A) ⇒ Input[B]): Input[B]
- def flatMapOp[B](g: (A) ⇒ Input[B])(op: (Input[B], Input[B]) ⇒ Input[B]): Input[B]
-
macro
def
fold[S, B](s0: S)(f: (S, A) ⇒ S): S
fold opeations, available inside async bloc.
fold opeations, available inside async bloc.
go { val sum = ch.fold(0){ (s,n) => s+n } }
-
macro
def
foreach(f: (A) ⇒ Unit): Unit
run
f
each time when new object is arrived.run
f
each time when new object is arrived. Ended when input closes.must be inside go/async/action block.
- def foreachAsync(f: (A) ⇒ Future[Unit])(implicit ec: ExecutionContext): Future[Unit]
- def foreachSync(f: (A) ⇒ Unit): Future[Unit]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def map[B](g: (A) ⇒ B): Input[B]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
or(other: Input[A]): Input[A]
synonim for non-deteremenistics choice.
- def prepend(a: A): Input[A]
-
macro
def
read: A
read object from channel.
read object from channel. Must be situated inside async/go/action block.
- def seq: AnyRef { def flatMap[B](g: A => gopher.channels.Input[B]): gopher.channels.Input[B] }
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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 withFilter(p: (A) ⇒ Boolean): Input[A]
-
def
withInputTimeouts(timeout: FiniteDuration): (Input[A], Input[FiniteDuration])
return pair of inputs
(ready, timeouts)
, such that when you read fromready
you receive element fromthis
and if during reading you wait more than specifiedtimeout
, than timeout message is appear intimeouts
return pair of inputs
(ready, timeouts)
, such that when you read fromready
you receive element fromthis
and if during reading you wait more than specifiedtimeout
, than timeout message is appear intimeouts
val (inReady, inTimeouts) = in withInputTimeouts (10 seconds) select.forever { case x: inReady.read => Console.println(s"received value ${value}") case x: inTimeouts.read => Console.println(s"timeout occured") }
- def zip[B](x: Input[B]): Input[(A, B)]
- def zip[B](x: Iterable[B]): Input[(A, B)]
-
def
|(other: Input[A]): Input[A]
return input merged with 'other'.
return input merged with 'other'. (i.e. non-determenistics choice)