krasserm / streamz

A combinator library for integrating Functional Streams for Scala (FS2), Akka Streams and Apache Camel
Apache License 2.0
282 stars 44 forks source link

Conversion from `fs2.Stream` to Akka `Source` Requires `ContextShift[IO]` #62

Closed robinspollak closed 5 years ago

robinspollak commented 5 years ago

Hello!

The following code does not compile with the implicits and imports specified in the documentation/examples:

    AkkaSource .fromGraph(
            stream (: fs2.Stream[IO, Int])
            .toSource
      )

with the error:

value toSource is not a member of fs2.Stream[cats.effect.IO, Int]

However, this code:

  implicit val cs = IO.contextShift(ec)
    AkkaSource .fromGraph(
            stream (: fs2.Stream[IO, Int])
            .toSource
      )

compiles as expected. It would be great to add the requirement for a ContextShift[IO] to the documentation!

krasserm commented 5 years ago

Hi Robin, thanks for reporting. Do you mind creating a pull request?

robinspollak commented 5 years ago

Sorry for the delay, just seeing this now. Does #64 work?