LOADING

Custom Stream Operators Made Safe And Simple with Libretto

How Libretto, a Scala DSL for concurrent programming, can be used for writing custom stream operators

Tomas Mikula
Functional Scala programmer with an urge to work on improving programming
About This Talk

Libraries for in-memory stream processing, such as FS2, ZIO Streams, Akka Streams, come with a set of built-in stream operators. However, when one needs a custom operator that's not already part of the library, things get complicated.Writing a non-trivial custom stream operator is difficult and error-prone. We are required to leave the safe world of declarative concurrency and enter the lower-level, unsafe world of side effects. We lose the static guarantee that things are wired up properly. We might even find ourselves manually manipulating queues, promises, mutable references, etc., while business logic gets buried in the resulting accidental complexity.

In this talk, I will show how Libretto, a Scala DSL for concurrent programming, can be used for writing custom stream operators. I will also demonstrate Libretto's integration with ZIO Streams.We will see that Libretto lets us focus on business logic rather than on low-level implementation details, thanks to its small but expressive set of built-in operations.

Moreover, stream operators written with Libretto are well-wired by construction. Bugs like polling an already closed stream or forgetting to complete a promise are prevented statically, i.e. before program execution.

more great talks

Might Be Interesting

Day 1
  —  
arrow pointing right icon

Full-Stack Scala 3 with the Typelevel Stack

A blueprint and approach for building end-to-end, full-stack applications in Scala 3

Day 2
  —  
arrow pointing right icon

Implicits in Scala 3

How Scala 3 addresses concerns around implicits and how implicits work in Scala 3.

Day 2
  —  
arrow pointing right icon

Building multiplayer game backend with Akka on AWS Lambda

How to implement fast and cost-effective backend for a multiplayer game using Scala, Akka and GraalVM

Day 1
  —  
arrow pointing right icon

Typesafe techniques for better sleep at night

I'll share a handful of techniques that can help you avoid runtime errors and shift them to the realm of compile time

Day 1
  —  
arrow pointing right icon

The future of WebAssembly for Scala.

As WebAssembly matures and gets more and more traction from the community, you might wonder can Scala join that trend?

Day 1
  —  
arrow pointing right icon

Pain-free APIs with Smithy4s

Avoid mistakes in API design, implementation and evolution with Smithy

See All Events
Join us!

We're looking for amazing speakers.
CFP is open till 10.01.2023

Fill in Call for Papers
location icon

Location

Centrum Konferencyjne POLIN, Poland
stay in touch icon

Follow Us

Contact Us