Skip to content

Convenient abstract API for working with streams

Notifications You must be signed in to change notification settings

m-plank/StreamsDSL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xxxx codecov

StreamsDSL

The main goal of the project is to provide abstract DSL for working with streams libraries on high level. So a developer can create simple and inpdependent pieces of code and switch quickly between streams implementations. Currently the project supports FS2 and Akka Streams.

Work in progress

Currently the project is in active development in experimental stage.

Quick example

import streams.dsl.internal.StreamIOAPI.from
import streams.dsl.internal.algebra.TextFileInput
import streams.dsl.internal.interpreters.StreamsAPI._
import streams.dsl.internal.{ Interpreter, MapTransform }
import scala.util.Try

trait DslExamples {
  def dsl[F[_]: Interpreter] =
    from(TextFileInput("src/test/resources/numbers.txt"))
      .through(map(str => Try(str.toInt).toEither))
      .collect { case Right(v) => v }
      .pure()
}

object Fs2Example extends App with DslExamples {
  import streams.dsl.FS2Implicits._

  def values = dsl.pureRun.unsafeRunSync().toList
  //List(1, 1, 2, 3, 5, 8)

}

object AkkaStreamsExample extends App with DslExamples {
  import streams.dsl.AkkaImplicits._

  def values = dsl.pureRun.unsafeRunSync().toList
  //List(1, 1, 2, 3, 5, 8)

}

See also Celsius example

About

Convenient abstract API for working with streams

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages