cps.monads.catsEffect
Type members
Classlikes
part of asyncScope
part of asyncScope
- See also
asyncScope
Monadic operations over F[] with brackets, can be used as main monad in case of deeple nested resources, to avoid nesting of scopes.
Monadic operations over F[] with brackets, can be used as main monad in case of deeple nested resources, to avoid nesting of scopes.
- See also
asyncScope
Value members
Concrete methods
Produce effect with resource-aware scope block.
Produce effect with resource-aware scope block.
val effect = asyncScope[IO] {
val reader = await(openFile(input))
val writer = await(openFile(output))
writer.transformFrom(0,Long.MaxValue,reader)
}
Here evaluation of effect will open reader and wrier, transfer data and then close reader and writer. block inside asyncScope evaluated in CpsResourceMonad[[X]=>>Resource[F,X]]
- See also
[cps.monads.catsEffect.CpsResourceMonad]
Concrete fields
Givens
Givens
Extensions
Extensions
Pseudo-synchronious syntax for resource, which can be used in async block.
Pseudo-synchronious syntax for resource, which can be used in async block.
async[IO] {
....
useing(openFile){ buffer =>
await(doSomething)
buffer.write(r)
result
}
}
Pseudo-synchronious syntax for resource, which can be used in async block.
Pseudo-synchronious syntax for resource, which can be used in async block.
async[IO] {
....
useing(openFile){ buffer =>
await(doSomething)
buffer.write(r)
result
}
}
Pseudo-synchronious syntax for resource, which can be used in async block.
Pseudo-synchronious syntax for resource, which can be used in async block.
async[IO] {
....
useing(openFile){ buffer =>
await(doSomething)
buffer.write(r)
result
}
}