Recently, I have been playing on Monix. In this article, I will focus on Monix Task, especially how a thread switches with Monix Task’s methods.

Image for post
Image for post

Monix Task

Monix Task is implemented in Monix which is an asynchronous and reactive programming Scala and Scala.js library.

Task is a data type for controlling possibly lazy & asynchronous computations, useful for controlling side-effects, avoiding nondeterminism and callback-hell.

Monix also provides streaming data type and purely functional utilities for managing concurrency such as monix-reactive, monix-catnap, and monix-tail.

The current latest major version is 3.3.0, released in November 2020.

Asynchronous Boundaries

An asynchronous boundary is a context switch between…


In my previous article, I introduced how to delete entities of Google Cloud Datastore in bulk with Dataflow. In this article, I’m going to introduce how to transfer entities of Google Cloud Datastore into BigQuery in bulk with Dataflow.

All entire code is on my Github repositories.

Motivation

Datastore is a scalable NoSQL database. Datastore supports ACID-compliant transactions, Indexing, etc. Therefore, it can be used for the management of general data on an application such as user profiles, sessions, etc. More information about the use case of Datastore is written in this link.

On the other hand, BigQuery is one of…


Image for post
Image for post

Recently, I have been interested in the Cats Effect which is a functional library in Scala. To improve my coding skills with Cats Effect, especially concurrency state management, I implemented a Circuit Breaker with this library. Circuit Breaker is one of the design patterns in software development. In the context of Microservices, this design pattern is popular.

In this article, I would like to explain a bit about Circuit Breaker Pattern and how to implement it with the Cats Effect. All entire code is on my Github repositories.

Circuit Breaker Pattern

Circuit Breaker Pattern is a design pattern of software development.

In a…


Image for post
Image for post

At times, we may need to delete entities of Google Cloud Datastore in bulk. For example, when customers have stopped using our service we may have to delete their data on our Datastore. In this case, Google Cloud Dataflow is suited for bulk deletion of entities according to this GCP document. Dataflow helps us to develop a data pipeline based on Apache Beam SDK. This also supports Java and Python.

In this article, I’m going to introduce a simple way to delete entities in bulk with Apache Beam Python SDK on Dataflow. …


Image for post
Image for post

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.


Image for post
Image for post

In a production environment, the application sometimes fails because of network connection timeout; quota exceeded calling External APIs and so on.
In this case, by retrying the action after a while, the application might succeed. 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.

In this article, I will explain how to implement a functional retry mechanism in Scala.

Simple retry handling

First of all, below is the simple program with a retry mechanism…


Image for post
Image for post

On the 29th of October 2019, Unipos held a Scala Meetup at the WeWork Sony Center in Berlin. Scala is one of the most popular programming languages globally and is used in some famous companies, for example linkedIn, Twitter, Netflix. One of the reason why is that Scala provides functional programming. At this event, the two speakers presented on the topic of “Functional Programming in Scala”.

Hiroki Fujino

Backend engineer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store