Resource.make
, it'll help you wrap things with a lifecycle
Guys, is there example how to work with cancelable IO
other than one in documentation? I cannot decipher it unfortunately. Here is what I want to achieve. I run synchronous DB query inside IO
. I want to let user of this IO cancel query on timeout. For that I need to call java.sql.Statement.cancel()
on statement that is used inside IO
. How can I do that ?
I looked at IO.runCancelable
and simply cannot understand how to use given SyncIO[CancelToken[IO]]
and how to link it with suspended action of parent IO
. Please advise.
IO
future.value
call that cats makes
future.onComplete
fromFuture
change, I'm just trying to rule out suspects