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
1
vote
1answer
28 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 ...
1
vote
0answers
722 views

WebSocket example with akka-http

Akka-http supports WS connections like that: ...
0
votes
2answers
831 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: ...
1
vote
0answers
68 views

Choosing names for “logic” and “implementation” traits in Stackable trait pattern

I have a trait that is to be mixed-in with existing types of Actor classes in Akka and offer a certain functionality. To offer better maintenance, I am using the stackable trait pattern. The ...
3
votes
1answer
78 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 ...
5
votes
0answers
677 views

Akka Streams Flow through a cache

Assume I have a cache: ...
1
vote
1answer
560 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 ...
9
votes
1answer
967 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 ...
2
votes
0answers
170 views

GitHub user graph crawler using akka

This code queries the GitHub followers API and stores the graph in a mongodb collection: ...
1
vote
1answer
408 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 -> ...
4
votes
2answers
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: ...
3
votes
0answers
250 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 ...
4
votes
1answer
592 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. ...
1
vote
0answers
90 views

Handling state in actor

The following Actor monitors file by getting events from watchservice actor that sends a message to the actor and notifies for event (create,modify or delete), would love to know how I may improve it....
2
votes
1answer
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 ...
4
votes
0answers
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 ...
3
votes
1answer
293 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 ...