Building a 1v1 Game Matchmaking Service in Go - Part 3
This article is part 3 of a series.
This article is part 3 of a series.
This article is part 2 of a series.
This article is Part 1 of a series.
Concurrent code is everywhere. Anytime you have multiple operations that can take a little time and happen simultaneously, you've got concurrent code. If you are reading and writing files, interacting with a database, or handling user interactions in a UI, you may have to deal with concurrency issues. We're going to take a look at a couple programming patterns and see how they fit in with concurrency.
Duality has different meanings in different domains, but the essential idea is that of 'two sides of the same coin'. There is one object, or one entity, and there are different ways of viewing it. The classic literature example is Dr. Jekyll and Mr. Hyde. One person, two different presentations of behavior.
In a previous article we looked at Finite State Transducers (FSTs). To quickly recap, a Finite State Transducer is a type of Finite State Machine that also produces output. This technique for structuring your code can work well with many modern programming paradigms and patterns. In this article, we're going to see how it fits in with the Functional Core, Imperative Shell (FCIS) pattern.
What is a Finite State Transducer? Your first guess might be that its an essential component of a car-based time machine, like a flux capacitor. It isn't, but believe it or not, we are going to travel back to 1955, have a chat with a George M, hopefully improve our lives in the present, and maybe even wrap a bulletproof vest around our code to protect it from unexpected disasters.
Here's a fun question you can use at parties: