Questions tagged [akka]

Akka is an actor-based framework for building distributed applications in Java or Scala. It facilitates the development of scalable middleware systems by taking care of lower-level concerns such as networking, threading, and database access, allowing the developer to focus on application logic. An Akka application is composed of actors (event handlers) that can be optionally deployed either local or remote to other actors without changing application code.

Filter by
Sorted by
Tagged with
2 votes
1 answer
239 views

Integrating caliban, ZIO and Akka

I created a small sample project using caliban, akka-persistence and ZIO. I'm not really happy with the wiring code: ...
TobiP's user avatar
  • 100
1 vote
0 answers
67 views

Akka FSM: Traffic Light Implementation

Recently I did an exercise to understand Akka FSM. I implemented a Traffic light system with Akka FSM which changes its state every 30 seconds. My code is like: ...
Karan Khanna's user avatar
2 votes
1 answer
195 views

Trading System with Akka

Recently I did an exercise to understand Akka. I implemented a trading system with Akka to process orders with Actors. My code is like: Order: Immutable class with acts as the messages in the ...
Karan Khanna's user avatar
1 vote
0 answers
1k views

WebSocket example with akka-http

Akka-http supports WS connections like that: ...
Nikita's user avatar
  • 111
0 votes
2 answers
2k views

HashMap used to store DateTime

I have a scenario where I need to save a string as a key and DateTime as value into a hash map. Also, I need to remove strings older than 24 hours. At the moment the HashMap is implemented as below: ...
Govs's user avatar
  • 189
3 votes
1 answer
89 views

Akka actor to calculate a soccer league rank

I am new to Scala / Akka and this is my first attempt at writing an actor. The task that I am trying to accomplish is: given a sequence of soccer matches, generate a ranking based on the usual rules ...
Alberto Venturini's user avatar
5 votes
0 answers
889 views

Akka Streams Flow through a cache

Assume I have a cache: ...
John M's user avatar
  • 151
1 vote
1 answer
693 views

Line count of each file in a given directory efficiently using akka

This is my first program in akka so I wanted to know if the program is efficient and is using the advantages of actor model. The program's purpose is to scan a given directory for any files and print ...
whokares's user avatar
  • 111
9 votes
1 answer
1k views

Approximating Pi, Monte Carlo integration

I wrote some code that uses Monte Carlo Integration to Approximate pi in Java and Akka. The tl;dr explanation is you can imagine throwing darts at a square with a circle inscribed inside of it. You ...
Dair's user avatar
  • 5,824
2 votes
0 answers
175 views

GitHub user graph crawler using akka

This code queries the GitHub followers API and stores the graph in a mongodb collection: ...
qed's user avatar
  • 1,429
1 vote
1 answer
523 views

Akka streams: Bidirectional flow that completes the stage when one side is completed

This is meant to be a bidirectional flow BidiFlow that works exactly as BidiFlow.identity, except that it completes the stage as soon as one of the Flows (in1 -> ...
Rüdiger Klaehn's user avatar
4 votes
2 answers
2k views

Limit HTTP request rate for spray/akka-http

I want to limit the request rate in a spray/akka-http route. I'm not an expert with both scala and spray/akka but learning. So I came up with the following custom directive: ...
TobiP's user avatar
  • 100
3 votes
0 answers
393 views

Finding the most frequent words in Scala using Akka

I'm new to akka and would like to get some feedback on my first attempt. The code takes text from stdin and finds the top 10 most frequently occurring words. Specifically, I would like to know Is ...
Jason Desrosiers's user avatar
4 votes
1 answer
621 views

Return different type of response based on Accept header

I'm a novice to Scala and Akka-Http and am experimenting with Akka-Http for writing rest services. I have to return JSON or protobuf based on the Accept-Header. ...
Vikas Naidu's user avatar
2 votes
1 answer
3k views

Distributing workload using Akka Router with exception handling

I am fairly new to Akka and I am interested in any feedback about the following code. Is this the correct way to go about distributing workload across a number of threads? Do I use the Akka API ...
Krzysiek Novak's user avatar
4 votes
0 answers
1k views

Configuring a JMS Component in akka-camel

I'm trying to write a JMS Consumer using Akka-Camel. For now, I'm using FFMQ as a JMS server. I want to listen on the JMS queue myqueue. Creating the JMS ...
Arnost Valicek's user avatar
3 votes
1 answer
309 views

Is this Scala/Akka idiomatic and correct for Akka 2.1?

I'm wondering if there is anything i'm overlooking in the code below. I've taken the Pi calculation example, simplified it and converted it to Akka 2.1. More specifically, i use the ask pattern to ...
nicerobot's user avatar
  • 131