Rafal Piotrowski
08/14/2019, 9:49 AMBob Glamm
08/14/2019, 12:41 PMBob Glamm
08/14/2019, 12:42 PMBob Glamm
08/14/2019, 12:49 PMBob Glamm
08/14/2019, 12:49 PMBob Glamm
08/14/2019, 12:50 PMIO
Rafal Piotrowski
08/14/2019, 1:05 PMsuspendCoroutine
is a clue here, I'm checking is it possible to make this more abstract with Async
typeclass still I cannot figure out is it possible or notBob Glamm
08/14/2019, 1:08 PMsuspend MonadThrowSyntax<F>.(args) -> Kind<F, result>
which enables fx
syntax within the adapted method blockBob Glamm
08/14/2019, 1:08 PMRafal Piotrowski
08/14/2019, 1:10 PMRafal Piotrowski
08/14/2019, 1:10 PMBob Glamm
08/14/2019, 1:10 PM.suspended()
boilerplate is built into 0.10.0-SNAPSHOT, so it would make it a little simpler. Let me see if I can make it polymorphic on Async<F>Bob Glamm
08/14/2019, 2:15 PMBob Glamm
08/14/2019, 2:16 PMBob Glamm
08/14/2019, 9:43 PMPipelineContext
and Async<F>.later()
might be promisingBob Glamm
08/14/2019, 11:27 PMget("quux") {
IO.async().effect(this.coroutineContext) {
call.respondText("QUUXER", ContentType.Text.Html)
}.fix().suspended()
}
Bob Glamm
08/14/2019, 11:29 PMsuspend (PipelineContext<Unit, ApplicationCall>) -> Kind<F, A>
.. I thinkBob Glamm
08/14/2019, 11:31 PMApplicationCall
is a side-effectBob Glamm
08/15/2019, 2:08 AMfun <F, TSubject: Any, TContext: Any> bridgeFactory(
AF: Async<F>,
PC: PipelineContext<TSubject, TContext>
): PipelineAsyncBridge<F, TSubject, TContext> =
object: PipelineAsyncBridge<F, TSubject, TContext>, Async<F> by AF, PipelineContext<TSubject, TContext> by PC {}
then in `routing`:
get("q2") { bridgeFactory(IO.async(), this).run {
effect(this.coroutineContext) {
call.respondText("Q2", ContentType.Text.Html)
}.fix().suspended()
}}