final class Handle[+F[_], +A] extends AnyRef
A currently open Stream[F,A]
which allows chunks to be pulled or pushed.
To get a handle from a stream, use Stream.open.
- Source
- Handle.scala
- Alphabetic
- By Inheritance
- Handle
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Handle[F, A], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
await: Pull[F, Nothing, (NonEmptyChunk[A], Handle[F, A])]
Waits for a chunk of elements to be available in the source stream.
Waits for a chunk of elements to be available in the source stream. The chunk of elements along with a new handle are provided as the resource of the returned pull. The new handle can be used for subsequent operations, like awaiting again.
-
def
await1: Pull[F, Nothing, (A, Handle[F, A])]
Like await but waits for a single element instead of an entire chunk.
-
def
await1Async[F2[_], A2 >: A](implicit S: Sub1[F, F2], F2: Async[F2], A2: RealSupertype[A, A2]): Pull[F2, Nothing, AsyncStep1[F2, A2]]
Like awaitAsync but waits for a single element instead of an entire chunk.
-
def
await1Option: Pull[F, Nothing, Option[(A, Handle[F, A])]]
Awaits the next available element from the input, or
None
if the input is exhausted. -
def
awaitAsync[F2[_], A2 >: A](implicit S: Sub1[F, F2], F2: Async[F2], A2: RealSupertype[A, A2]): Pull[F2, Nothing, AsyncStep[F2, A2]]
Asynchronously awaits for a chunk of elements to be available in the source stream.
Asynchronously awaits for a chunk of elements to be available in the source stream. An async step is returned as the resource of the returned pull. The async step is a ScopedFuture, which can be raced with another scoped future or forced via ScopedFuture#pull.
-
def
awaitLimit(maxChunkSize: Int): Pull[F, Nothing, (NonEmptyChunk[A], Handle[F, A])]
Like await, but returns a
NonEmptyChunk
of no more thanmaxChunkSize
elements. -
def
awaitN(n: Int, allowFewer: Boolean = false): Pull[F, Nothing, (List[NonEmptyChunk[A]], Handle[F, A])]
Returns a
List[NonEmptyChunk[A]]
from the input whose combined size has a maximum valuen
. -
def
awaitOption: Pull[F, Nothing, Option[(NonEmptyChunk[A], Handle[F, A])]]
Awaits the next available chunk from the input, or
None
if the input is exhausted. -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
copy: Pull[F, A, Handle[F, A]]
Copies the next available chunk to the output.
-
def
copy1: Pull[F, A, Handle[F, A]]
Copies the next available element to the output.
-
implicit
def
covary[F2[_]](implicit S: Sub1[F, F2]): Handle[F2, A]
Converts this handle to a handle of the specified subtype.
-
def
drop(n: Long): Pull[F, Nothing, Handle[F, A]]
Drops the first
n
elements of thisHandle
, and returns the newHandle
. -
def
dropWhile(p: (A) ⇒ Boolean): Pull[F, Nothing, Handle[F, A]]
Drops elements of the this
Handle
until the predicatep
fails, and returns the newHandle
.Drops elements of the this
Handle
until the predicatep
fails, and returns the newHandle
. If non-empty, the first element of the returnedHandle
will failp
. -
def
echo: Pull[F, A, Nothing]
Writes all inputs to the output of the returned
Pull
. -
def
echo1: Pull[F, A, Handle[F, A]]
Reads a single element from the input and emits it to the output.
Reads a single element from the input and emits it to the output. Returns the new
Handle
. -
def
echoChunk: Pull[F, A, Handle[F, A]]
Reads the next available chunk from the input and emits it to the output.
Reads the next available chunk from the input and emits it to the output. Returns the new
Handle
. - def ensuring(cond: (Handle[F, A]) ⇒ Boolean, msg: ⇒ Any): Handle[F, A]
- def ensuring(cond: (Handle[F, A]) ⇒ Boolean): Handle[F, A]
- def ensuring(cond: Boolean, msg: ⇒ Any): Handle[F, A]
- def ensuring(cond: Boolean): Handle[F, A]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fetchN(n: Int): Pull[F, Nothing, Handle[F, A]]
Like
awaitN
, but leaves the buffered input unconsumed. -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find(f: (A) ⇒ Boolean): Pull[F, Nothing, (A, Handle[F, A])]
Awaits the next available element where the predicate returns true.
-
def
fold[B](z: B)(f: (B, A) ⇒ B): Pull[F, Nothing, B]
Folds all inputs using an initial value
z
and supplied binary operator, and writes the final result to the output of the suppliedPull
when the stream has no more values. -
def
fold1[A2 >: A](f: (A2, A2) ⇒ A2): Pull[F, Nothing, A2]
Folds all inputs using the supplied binary operator, and writes the final result to the output of the supplied
Pull
when the stream has no more values. -
def
forall(p: (A) ⇒ Boolean): Pull[F, Nothing, Boolean]
Writes a single
true
value if all input matches the predicate,false
otherwise. - def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last: Pull[F, Nothing, Option[A]]
Returns the last element of the input, if non-empty.
-
def
map[A2](f: (A) ⇒ A2): Handle[F, A2]
Applies
f
to each element from the source stream, yielding a new handle with a potentially different element type. -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
peek: Pull[F, Nothing, (Chunk[A], Handle[F, A])]
Like await but does not consume the chunk (i.e., the chunk is pushed back).
-
def
peek1: Pull[F, Nothing, (A, Handle[F, A])]
Like await1 but does not consume the element (i.e., the element is pushed back).
-
def
prefetch[F2[_]](implicit sub: Sub1[F, F2], F: Async[F2]): Pull[F2, Nothing, Pull[F2, Nothing, Handle[F2, A]]]
Like await, but runs the
await
asynchronously.Like await, but runs the
await
asynchronously. AflatMap
into innerPull
logically blocks until this await completes. -
def
push[A2 >: A](c: Chunk[A2])(implicit A2: RealSupertype[A, A2]): Handle[F, A2]
Returns a new handle with the specified chunk prepended to elements from the source stream.
-
def
push1[A2 >: A](a: A2)(implicit A2: RealSupertype[A, A2]): Handle[F, A2]
Like push but for a single element instead of a chunk.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
take(n: Long): Pull[F, A, Handle[F, A]]
Emits the first
n
elements of the input and return the newHandle
. -
def
takeRight(n: Long): Pull[F, Nothing, Vector[A]]
Emits the last
n
elements of the input. -
def
takeThrough(p: (A) ⇒ Boolean): Pull[F, A, Handle[F, A]]
Like
takeWhile
, but emits the first value which tests false. -
def
takeWhile(p: (A) ⇒ Boolean): Pull[F, A, Handle[F, A]]
Emits the elements of this
Handle
until the predicatep
fails, and returns the newHandle
.Emits the elements of this
Handle
until the predicatep
fails, and returns the newHandle
. If non-empty, the returnedHandle
will have a first elementi
for whichp(i)
isfalse
. -
def
toString(): String
- Definition Classes
- Handle → 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 →[B](y: B): (Handle[F, A], B)