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
-3
votes
0answers
25 views

Monte-Carlo Pi calculation with akka negative values [closed]

SO im trying to use the Akka actor-message model to estimate the value of PI. I think im close, but so my im not there yet. I was able to have pi returning values from 1000 to -6000 and trying to fix ...
1
vote
0answers
623 views

WebSocket example with akka-http

Akka-http supports WS connections like that: ...
0
votes
2answers
710 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
67 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
653 views

Akka Streams Flow through a cache

Assume I have a cache: ...
1
vote
1answer
550 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
945 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
169 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
400 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
245 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
586 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 ...