SwayDB
SwayDB copied to clipboard
Support external Streaming libraries
Internal Stream is a very basic Stream implementation (intentional) which makes it easier to interop with Java. Akka Streams, FS2, Scalaz-stream, ZIO-streams etc should all be supported.
Currently each database instance can produce the following Streamer type (similar to an Iterator[T]). This type basically starts iteration from head and fetches the next item in the Stream given the previously read item on request.
trait Streamer[A, T[_]] {
def head: T[Option[A]]
def next(previous: A): T[Option[A]]
}
If there is a way to interop with all other streaming libraries given the above type then supporting others will be easier.
Reactive Stream is another way to support interop but is complex to implement see #57.