Skip to content
No description, website, or topics provided.
Scala
Branch: master
Clone or download
vilu and ghostdogpr 1561 Stop depending on core-tests (#29)
* 1561 Stop depending on core-tests

* 1561 Fix exception thrown in test

*  1561 Cleanup

* 1561 Make test 2.11 compatible

* 1561 Formatting

* 1561 Stop depending on specs2

* 1561 Formatting
Latest commit 19932d4 Sep 13, 2019

README.md

Interop Twitter

CircleCI

This library provides capability to convert Twitter Future into ZIO Task.

Example

import com.twitter.util.Future
import zio.{ App, Task }
import zio.console._
import zio.interop.twitter._

object Example extends App {
  def run(args: List[String]) = {
    val program =
      for {
        _        <- putStrLn("Hello! What is your name?")
        name     <- getStrLn
        greeting <- Task.fromTwitterFuture(Task(greet(name)))
        _        <- putStrLn(greeting)
      } yield ()

    program.fold(_ => 1, _ => 0)
  }

  private def greet(name: String): Future[String] = Future.value(s"Hello, $name!")
}
You can’t perform that action at this time.