Creating WebSocket subscription server with Akka

Akka documentation contains a basic example of a simple WebSocket server, but it just sends back a message it has received. Building on top of it to have an Actor handling user messages and sending data back to the user is not obvious. Let’s build a simple WebSocket server with a /clock endpoint. After connecting, a client can subscribe to receive time in the requested timezones. It is not a very useful application, but the concept is the same if you would like to build a subscription for chat, real-time game, or stock price updates. [Read More]

My roulette strategy

There are few popular roulette strategies out there. Most of them are based on the idea of adjusting your stake as you keep playing so when you finally win, it will cover all your past loses and make some profit. Most known is the Martingale strategy. You bet on red or black and double your bet after a loss. Sooner or later, you will win and make a profit equal to your initial bet. [Read More]

Async vs Sync Communication

We can divide communication into two channels: Synchronous (Sync) - all parties are actively taking part in the conversation right now. For example, physical meetings or a video call Asynchronous (Async) - one party writes or records a message and has to wait for responses for an indefinite amount of time. For example, sending an email or posting on a discussion board. Conversations on sync channels are usually recorded only in the heads of the participants where async channels are a more permanent medium. [Read More]