We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
At this moment, users of frees-rpc have to define several implicits that are repeated once again.
frees-rpc
We could offer them just importing:
import freestyle.rpc.server.implicits._ or import freestyle.rpc.client.implicits._, depending on the case.
import freestyle.rpc.server.implicits._
import freestyle.rpc.client.implicits._
For example, something like the following can be provided by the library:
trait FutureInstances extends freestyle.rpc.client.FutureInstances { protected val atMostDuration: FiniteDuration = 10.seconds implicit def futureComonad(implicit ec: ExecutionContext): Comonad[Future] = new Comonad[Future] { def extract[A](x: Future[A]): A = { logger.info(s"${Thread.currentThread().getName} Waiting $atMostDuration for $x...") Await.result(x, atMostDuration) } override def coflatMap[A, B](fa: Future[A])(f: (Future[A]) => B): Future[B] = Future(f(fa)) override def map[A, B](fa: Future[A])(f: (A) => B): Future[B] = fa.map(f) } implicit val future2Task: Future ~> Task = new (Future ~> Task) { override def apply[A](fa: Future[A]): Task[A] = { logger.info(s"${Thread.currentThread().getName} Deferring Future to Task...") Task.deferFuture(fa) } } }
Here, perhaps:
https://github.com/frees-io/freestyle-rpc/blob/5180a8f88785cf55a636bfe18269cbbf6b7b1b2a/rpc/src/main/scala/client/implicits.scala#L28-L35
The text was updated successfully, but these errors were encountered:
juanpedromoreno
No branches or pull requests
At this moment, users of
frees-rpc
have to define several implicits that are repeated once again.We could offer them just importing:
import freestyle.rpc.server.implicits._
orimport freestyle.rpc.client.implicits._
, depending on the case.For example, something like the following can be provided by the library:
Here, perhaps:
https://github.com/frees-io/freestyle-rpc/blob/5180a8f88785cf55a636bfe18269cbbf6b7b1b2a/rpc/src/main/scala/client/implicits.scala#L28-L35
The text was updated successfully, but these errors were encountered: