streamadapter
package streamadapter
a toolkit for adapting streams from one streaming library into another streaming library
- Alphabetic
- By Inheritance
- streamadapter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Chunkerator
[+A] extends () ⇒ CloseableChunkIter[A]
a closeable chunk iterator generator.
a closeable chunk iterator generator. whenever the function is called, it produces an iterator for the same underlying resource. this is necessary for the enumerators to be reusable, ie, produce the same stream of elements when used with two iteratees, and not produce an empty stream when used a second time. note, however, that the iterators returned by this generating function do not have to produce the exact same results. allowance is made for the fact that the underlying resource may be a changeable resource. for instance, we could be iterating over the contents of a file, and some other process might modify the file in the meantime.
at this point, Chunkerator serves as our common interchange format for publishers - we will try to get to and from conversions for this type, from each stream type we handle. we can then convert between any two publisher types using this one as a mediator.
-
trait
CloseableChunkIter
[+A] extends CloseableIter[Seq[A]]
a closeable iterator of chunks.
a closeable iterator of chunks. has method
close: Unit
, along with the standardIterator
methods, so that enumerator can be closed early when the iteratee is complete. -
trait
CloseableIter
[+A] extends Iterator[A]
a closeable iterator.
a closeable iterator. has method
close: Unit
, along with the standardIterator
methods, so that enumerator can be closed early when the iteratee is complete. -
trait
StreamAdapter
[P1[_], P2[_]] extends AnyRef
adapts streams from one streaming library into another streaming library
adapts streams from one streaming library into another streaming library
- P1
the type of stream to adapt from
- P2
the type of stream to adapt into
Value Members
-
def
adapt[P1[_], P2[_], A](p1: P1[A])(implicit pa: StreamAdapter[P1, P2]): P2[A]
adapts a stream of elements from one streaming library into a stream from another streaming library
adapts a stream of elements from one streaming library into a stream from another streaming library
- P1
the type of stream to adapt from
- P2
the type of stream to adapt into
- A
the type of the elements of the stream
- p1
the stream to adapt
- returns
the adapted stream
-
implicit
def
chain[P1[_], P2[_]](implicit pa1: StreamAdapter[P1, Chunkerator], pa2: StreamAdapter[Chunkerator, P2]): StreamAdapter[P1, P2]
chains two stream adapters together to create a new one.
chains two stream adapters together to create a new one. the intermediary in the chain is hardcoded to
Chunkerator
.the idea being, every streaming library has adapters into and out of
Chunkerator
, and then we can adapt between two arbitrary streaming libraries. -
object
Chunkerator
contains factory methods for producing chunkerators
-
object
CloseableChunkIter
contains factory methods for producing closeable chunk iters