Futures

Exceptions and Futures in Zio

Reading Time: 3 minutes ZIO is an open-source library that delivers a better “Future” for asynchronous and concurrent programming in Scala. Similarly, we can’t retry a Future in the event of failure, like we can for ZIO, because a Future isn’t a blueprint for doing something—it’s an executing computation. So if a Future fails, there is nothing else to do. We can only retrieve the failure. The central “type Continue Reading

How to use MDC Logging in Scala?

Reading Time: 4 minutes In this blog, we’ll discuss Mapped Diagnostic Context, in short MDC. Also, we’ll see how we can use it across a single thread or multiple threads(or Futures) using some examples. What is MDC Logging? Multi-user applications need log messages to retain context. The Mapped Diagnostic Context(MDC) allows us to put context to all the log statements for a single thread. We can also propagate MDC across multiple Continue Reading

Java8 Futures: Introduction & Best Practices

Reading Time: 3 minutes Hi there! Today, we are going to talk about Futures in Java. We will also look at some of the best practices related to them. What are Java Futures and why do we need them? To understand this better, firstly we must understand what is blocking and why is it bad for our software. BLOCKING – A blocking/long-running call occurs when a thread is tied Continue Reading

Threading and Futures in Java

Reading Time: 4 minutes Welcome readers, this blog is all about threading in Java. After reading this, you would be comfortable enough to program multi-threaded applications. Here, you will learn about java threads, thread pools and the concept of java future. Java Threading: The Beginning In Java, the concept of multi-threading was there from the first version itself. In Java, you can implement threading by implementing Runnable interface and Continue Reading

Knolx Session: Using Akka Futures

Reading Time: < 1 minute I presented Akka Futures at Knolx session at Knoldus. This session I talked about basics of Futures. Examples were similar to my posts on Akka Futures: Using For Expression and Akka Futures In Scala With A Simple Example.

Akka Actor And Futures

Reading Time: < 1 minute This presentation was presented at Knolx session. It was presented before my last post on Akka Futures with a simple example. It focusses on Akka 2.0 and Akka Futures. Please note that in latest Akka version which is for scala 2.10, Scala Future and Akka Future has combined. This presentation caters to Akka 2.0.5 version. This talk is inspired by Viktor Klang talk on Akka Continue Reading

Akka Futures In Scala With A Simple Example

Reading Time: 3 minutes We use Akka Futures extensively for a product built to handle huge load of streaming data. We have been early adopters of Akka and been using it right from its Akka 1.1.X days. We found Futures as simple yet powerful tool to add concurrent behavior in our application. This post emphasizes importance of Akka Futures with a short and easy to understand example application. Please Continue Reading