Scala Meetup @ Berlin, 12th Feb 2020

Hiroki Fujino
2 min readFeb 18, 2020

On the 12th of February 2020, Unipos held a Scala Meetup at the WeWork Sony Center in Berlin. At this event, the two speakers presented.

Functional Error&Retry Handling

At first, Hiroki Fujino who works at Unipos talked about Error and Retry Handling with Scala.

In a production environment, the developers can not avoid error handling. In Scala, there are some Monads (Option, Either, Try, etc.), which can be used for error handling. At times we need a generic error handling code. MonadError type class helps us to develop it.

On the other hand, the errors can be temporary such as network connection timeout, quota exceeded calling External APIs and so on. In these cases, by retrying the action after a while, the application might succeed. However, implementing a retry mechanism tends to be complicated as it requires many things; how many times the program retries the action, how long the program waits between attempts, how to output the log during retrying and so on. Cats-retry provides a powerful retry mechanism to develop that.

In the presentation, it was explained how to handle the error with MonadError and retry with cats-retry.

The presentation and sample code are in the links below.

Scala & Concurrency

Next, Nikhil Anurag who works at Zalando talked about concurrent programming with Scala.

There are some libraries that support concurrent programmings such as Akka Actors, Monix, ZIO, and Cats-Effect. These libraries encapsulate the complexity of concurrent programming. But to write high performance and responsive programs, developers need to understand how Scala runs concurrently on JVM. His presentation started with the basics of concurrent programming; the difference between concurrency and parallelism, concurrency on JVM and Thread Pools. Then he talked about concurrency in Scala and Project Loom.

His presentation is in the link below.

Scala developers who are using Scala at their companies attended this meetup. Everyone enjoyed the event and after the presentation, many stayed to discuss what they had learned.

--

--