~/talk

Resource Management Made Easy: Introducing Resource from cats-effect Library

Talkat Scala Days 2023 Madrid · 2023-09-12..09-14· [scala]
slides:none on file

Compares Scala 2.13’s using and shutdown hooks with cats-effect Resource, showing that Resource uses IO to support asynchronous execution, cancellation, and proper multi-error linking; demos include an HTTP/server and doobie/http4s integrations and a queue consumer implemented with resource.makeCase and ExitCase that re-enqueues failed items (demo shows element 2 returned to the queue and processing stops with an exception). Recommends FS2 streams for large or streaming datasets with built-in finalizers. Suitable if the project accepts an effect type.

AI-written summary · about

  1. 0:00Introduction
  2. 1:09What is a resource
  3. 3:19Why resource management matters
  4. 5:44Finalization logic importance
  5. 6:27Shutdown hooks solution
  6. 8:13Limitations of try-catch
  7. 12:05Scala's using introduced
  8. 16:00How using works
  9. 17:26Limitations of Scala's using
  10. 19:09Resource from cats-effect
  11. 23:04Creating Resource in cats-effect
  12. 24:07Combining multiple resources
  13. 25:07Advantages of Resource
  14. 26:33Finalization based on outcome
  15. 31:53Resource benefits summary
  16. 32:38Choosing the right tool
  17. 34:05FS2 streams for resources
  18. 36:14Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.