Re: [akka-user] import context.dispatcher nullpointerexception

2018-03-06 Thread Viktor Klang
Context is bound to the lifecycle of the actor. On Tue, Mar 6, 2018 at 8:37 PM, Jeff wrote: > I have noticed an issue where if a future maps/flatmaps after actor > shutdown, a NullPointerException is thrown. I've narrowed it down to the > import > context.dispatcher,

Re: [akka-user] Re: HTTP server performance

2018-02-21 Thread Viktor Klang
What does wrk2 say w.r.t. throughput? Are you testing pipelined requests or new connections for each request? Are you testing over network or not? On Wed, Feb 21, 2018 at 12:25 AM, Mirek Suk wrote: > Lesser = less maximum threads. Akka has minimum which is "high" for 2

Re: [akka-user] Re: HTTP server performance

2018-02-20 Thread Viktor Klang
On Tue, Feb 20, 2018 at 11:46 PM, Mirek Suk wrote: > I doubt dispatcher is problem as forkjoinpool with default (and lesser > settings due to tests required by ops) were tried. > What do you mean by "lesser settings"? How did changing pool size and/or throughput affect

Re: [akka-user] HTTP server performance

2018-02-20 Thread Viktor Klang
What dispatcher tuning did you experiment with? On Tue, Feb 20, 2018 at 10:57 PM, Mirek Suk wrote: > Only a few of them could affect CPU consumption and throuput, unless they > mean something else. > Besides that as I mentioned in op throuput degradation was "random" and

Re: [akka-user] HTTP server performance

2018-02-20 Thread Viktor Klang
Ok. So besides the common dispatcher tuning tips, JVM tuning tips, and Linux IO tuning tips there's also a lot of settings for Akka Http specifically. On Tue, Feb 20, 2018 at 6:23 PM, Mirek Suk wrote: >

Re: [akka-user] HTTP server performance

2018-02-20 Thread Viktor Klang
The top hit for me when searching for "tuning akka http" is: https://stackoverflow.com/questions/41297334/akka-http-performance-tuning On Tue, Feb 20, 2018 at 5:39 PM, Mirek Suk wrote: > There is not much to change in akka http server configuration. Care to > share any

Re: [akka-user] HTTP server performance

2018-02-20 Thread Viktor Klang
Mirek, As a general note: Benchmarking using default configuration is almost pointless* since a default configuration is—by definition, and by necessity—a configuration which will not be *optimal for a specific use-case*. *It can be useful as a baseline for tuning. On Mon, Feb 19, 2018 at 11:30

Re: [akka-user] Akka stream out of band data

2018-02-18 Thread Viktor Klang
How do you deal with M:N ports or X:Y element permutations? -- Cheers, √ On Feb 18, 2018 01:53, "Christopher Hunt" wrote: > Hi there, > > I’ve been wondering recently if there’s been any thought around carrying > out of band data through an Akka Stream in the spirit of

Re: [akka-user] Request for help on Improving Scalability for Akka Streams Program

2018-01-11 Thread Viktor Klang
Where is your bottleneck? On Thu, Jan 11, 2018 at 12:17 PM, wrote: > Hi Everyone, > > I am learning Scala and Akka Streams, I would kindly like to request for > help on enhancing my small Akka Streams Program so that it can scale with > increase in data. Below are

Re: [akka-user] Re: How to measure performance of Actor Message from one actor reaching to another actor

2017-12-15 Thread Viktor Klang
Also, is serialization/deserialization included? At what point does the timer clock start, and when does it stop? -- Cheers, √ On Dec 15, 2017 20:31, "Patrik Nordwall" wrote: > What are you interested in? Throughput (msg/s) or latency (us)? Remote or > local? What

Re: [akka-user] Preventing Memory Leaks

2017-11-19 Thread Viktor Klang
The ActorRef won't prevent the Actor-instance from being garbage-collected. But if you want to avoid hanging onto stale ActorRefs I'd recommend using Death Watch and remove the refs as they are reported in as dead. On Sun, Nov 19, 2017 at 8:13 PM, Joseph Mansigian < joseph.c.mansig...@gmail.com>

Re: [akka-user] Allowing SecurityException to propagate during actor system termination

2017-11-13 Thread Viktor Klang
<hunt...@gmail.com> wrote: > Ah yes, uncaught. Thanks for the correction. > > On 13 Nov 2017, at 21:12, Viktor Klang <viktor.kl...@gmail.com> wrote: > > When you say "unhandled exception" you mean "uncaught exception"? > > On Mon, Nov 13, 2017 at

Re: [akka-user] Allowing SecurityException to propagate during actor system termination

2017-11-13 Thread Viktor Klang
When you say "unhandled exception" you mean "uncaught exception"? On Mon, Nov 13, 2017 at 4:48 AM, Christopher Hunt wrote: > Hi everyone, > > I have a situation where I need to call System.exit upon an actor system > having terminated. In some runtime situations, a

Re: [akka-user] Re: Usage of StreamConverters.asOutputStream / possible alternative API?

2017-10-26 Thread Viktor Klang
Yup On Thu, Oct 26, 2017 at 3:51 PM, Rafał Krzewski wrote: > Hi Viktor, > > I'm passing the OutputStream to a single method that does a bunch of > writes synchronously and as soon as it returns I do os.close() so I should > be good, no? > > Cheers, > Rafał > > W dniu

Re: [akka-user] Re: Usage of StreamConverters.asOutputStream / possible alternative API?

2017-10-26 Thread Viktor Klang
Be careful though, as you need to ensure proper happens-before relationship between the writes and the closing of the OutputStream. (and other writes of course) On Thu, Oct 26, 2017 at 1:56 PM, Rafał Krzewski wrote: > That worked like a charm :) Thanks a lot Johan! > >

Re: [akka-user] FlowOps concat with Source.fromFuture behaviour

2017-10-25 Thread Viktor Klang
On Wed, Oct 25, 2017 at 1:16 PM, Christopher Hunt <hunt...@gmail.com> wrote: > > > > On 25 Oct 2017, at 21:05, Viktor Klang <viktor.kl...@gmail.com> wrote: > > > > Does it behave differently from > > `Source.single(somePromise.future).mapAsync(1)(i

Re: [akka-user] FlowOps concat with Source.fromFuture behaviour

2017-10-25 Thread Viktor Klang
Does it behave differently from `Source.single(somePromise.future).mapAsync(1)(identity)` ? On Wed, Oct 25, 2017 at 12:01 PM, Christopher Hunt wrote: > Hey community, > > I've got a situation where there's a promise that, when completed, I'd > like to concat its value onto

Re: [akka-user] Spray->Akka-Http Migration - seeing high 99th percentile latencies post-migration

2017-10-23 Thread Viktor Klang
slow request/second to > throw off the percentiles (which is what I think is happening). > > > > On Mon, Oct 23, 2017 at 4:20 PM, Viktor Klang <viktor.kl...@gmail.com> > wrote: > >> What definition of latency are you using? (i.e. how is it derived) >> >>

Re: [akka-user] Spray->Akka-Http Migration - seeing high 99th percentile latencies post-migration

2017-10-23 Thread Viktor Klang
What definition of latency are you using? (i.e. how is it derived) On Mon, Oct 23, 2017 at 10:11 PM, Gary Malouf wrote: > Hi Konrad, > > Our real issue is that we can not reproduce the results. The web server > we are having latency issues with is under peak load of

Re: [akka-user] Ask not working if Future is used in receive partial method

2017-10-14 Thread Viktor Klang
Hi Danny, there are two problems: 1) https://doc.akka.io/docs/akka/current/scala/additional/faq.html#sender-getsender-disappears-when-i-use-future-in-my-actor-why- 2) https://doc.akka.io/docs/akka/current/scala/general/jmm.html#jmm-shared-state Happy hakking! On Fri, Oct 13, 2017 at 6:59 PM,

Re: [akka-user] problem with pinned dispatcher

2017-08-01 Thread Viktor Klang
«Note that it’s not guaranteed that the *same* thread is used over time, since the core pool timeout is used for PinnedDispatcher to keep resource usage down in case of idle actors. To use the same thread all the time you need to add thread-pool-executor.allow-core-timeout=off to the configuration

Re: [akka-user] [ANNOUNCE] ChanaMQ - an Akka based AMQP messaging broker

2017-07-28 Thread Viktor Klang
Would be interesting to see if the new AffinityPool would make any difference. On Thu, Jul 27, 2017 at 10:44 PM, Caoyuan wrote: > > > On Thursday, July 27, 2017 at 12:47:39 PM UTC-7, √ wrote: >> >> Very consistent. What's the current bottleneck? >> > > Not too much so far.

Re: [akka-user] [ANNOUNCE] ChanaMQ - an Akka based AMQP messaging broker

2017-07-27 Thread Viktor Klang
Very consistent. What's the current bottleneck? On Thu, Jul 27, 2017 at 7:52 PM, Caoyuan wrote: > Below is the latency in ms when applying 1-publishers - 100-consumers: > > > "max-latency":15.044784, > "min-latency":13.960142, > "avg-latency":14.623772, >

Re: [akka-user] [ANNOUNCE] ChanaMQ - an Akka based AMQP messaging broker

2017-07-25 Thread Viktor Klang
Cool. What does the p90 and p99 look like? -- Cheers, √ On Jul 25, 2017 12:19 AM, "Caoyuan" wrote: > I've got some preliminary benchmarks. As the maximized distributed design > of ChanaMQ. It's bit lagging behind RabbitMQ when applying a few > publishers/consumers, but

Re: [akka-user] [ANNOUNCE] ChanaMQ - an Akka based AMQP messaging broker

2017-07-24 Thread Viktor Klang
Cool! What kind of scalability profile are you getting? On Fri, Jul 21, 2017 at 9:20 PM, Caoyuan wrote: > Hi, > > We are developing an AMQP messaging broker - ChanaMQ, which is based on > Akka actors and Akka streaming. > > It's currently under Alpha phase, but with lots of

Re: [akka-user] remoting comparison: Artery vs Netty

2017-07-03 Thread Viktor Klang
Likely bottlenecked either by network or serialization method (or quite possibly both?). -- Cheers, √ On Jul 3, 2017 1:06 PM, "Patrik Nordwall" wrote: > What is the unit of the values in the table, e.g. 416? I guess it's > milliseconds? > > That doesn't match our

Re: [akka-user] Is ExecutionContext.reportFailure working?

2017-06-20 Thread Viktor Klang
happy hakking! On Tue, Jun 20, 2017 at 10:32 PM, Sean Shubin wrote: > Regarding #1, that is the information I was missing, thank you for > clearing that up. Hopefully that will guide me to how to test asynchronous > code with an synchronous execution context. > >

Re: [akka-user] Is ExecutionContext.reportFailure working?

2017-06-20 Thread Viktor Klang
Hi Sean, On Tue, Jun 20, 2017 at 12:51 AM, Sean Shubin wrote: > While I was trying to stub out an execution context to test concurrent > code, I noticed some surprising behavior demonstrated below. I would have > expected the exception thrown by the Future to cause

Re: [akka-user] Role of Akka in SMACK

2017-04-30 Thread Viktor Klang
On Fri, Apr 28, 2017 at 4:52 PM, Shiva Ramagopal <tr.s...@gmail.com> wrote: > Viktor, > > > On Fri, Apr 28, 2017 at 5:03 PM, Viktor Klang <viktor.kl...@gmail.com> > wrote: > >> >> >> On Fri, Apr 28, 2017 at 1:12 PM, Shiva Ramagopal <tr.s...@gm

Re: [akka-user] Role of Akka in SMACK

2017-04-28 Thread Viktor Klang
On Fri, Apr 28, 2017 at 1:12 PM, Shiva Ramagopal <tr.s...@gmail.com> wrote: > Hi Viktor, > > On Fri, Apr 28, 2017 at 2:55 PM, Viktor Klang <viktor.kl...@gmail.com> > wrote: > >> Hi Shiva, >> >> On Fri, Apr 28, 2017 at 11:20 AM, Shiva Ramagopal <

Re: [akka-user] Role of Akka in SMACK

2017-04-28 Thread Viktor Klang
geting and what scalability curve? > > On Thu, Apr 27, 2017 at 8:31 PM, Viktor Klang <viktor.kl...@gmail.com> > wrote: > >> >> >> On Thu, Apr 27, 2017 at 10:39 AM, Shiva Ramagopal <tr.s...@gmail.com> >> wrote: >> >>> Hi, >

Re: [akka-user] Actor name is not unique after termination when running from unit tests

2017-04-27 Thread Viktor Klang
Hi Piotr, the test thread having observed the termination does not mean that the user guardian (/user) has observed it. On Thu, Apr 27, 2017 at 4:53 PM, Piotr Droździel wrote: > Hello, > Akka docs say: > >> Warning >> >> Keep in mind that an actor stopping and its name

Re: [akka-user] is it possible to assure every message to be processed

2017-04-27 Thread Viktor Klang
Hi! On Thu, Apr 27, 2017 at 9:08 AM, Laxmi Narayan wrote: > Hi , > > I am working a high scalable application where I want to use akka as > processing framework. > > But after reading not 100% guaranteed delivery I am actually afraid of > using it. > Nothing in the world

Re: [akka-user] Role of Akka in SMACK

2017-04-27 Thread Viktor Klang
On Thu, Apr 27, 2017 at 10:39 AM, Shiva Ramagopal wrote: > Hi, > > I have read through multiple articles describing the SMACK stack but I'm > having difficulty understanding the role of Akka in the stack. How does > Akka fit in? > Akka is for building the application itself.

Re: [akka-user] Best way to handle large response from Actor

2017-04-27 Thread Viktor Klang
For that kind of "messages" I'd recommend using URLs and using a transport protocol with builtin resumes etc, such as HTTP, FTP etc. On Wed, Apr 26, 2017 at 8:19 PM, Sumanta Dutta wrote: > Hi, we generally use ask pattern to handle request-response between client > and Akka

Re: [akka-user] Getting Classcase exception in TestNG while creating actor

2017-04-12 Thread Viktor Klang
ActorSystem.apply/create takes an optional ClassLoader if the current thread context classloader isn't correct. -- Cheers, √ On Apr 12, 2017 6:43 AM, "Pradeep B K" wrote: > Hi All, > I am seeing below exception when I try to create ActorSystem in TestNG > > *16:05:15*

Re: [akka-user] Re: Understanding 'Leader can currently not perform its duties' message

2017-04-04 Thread Viktor Klang
No, it needs to be Downed. On Tue, Apr 4, 2017 at 9:50 AM, Unmesh Joshi wrote: > Hi, > > If I restart the crashed node on same host and port, it should be > reachable now and consensus should be reached isnt it? > > Thanks, > Unmesh > > On Tuesday, 4 April 2017 13:09:22

Re: [akka-user] How akka cluster become network partition

2017-03-16 Thread Viktor Klang
Disconnect the cable between A and B. Reconnect cable after the auto-downer has trigger. On Thu, Mar 16, 2017 at 12:08 PM, Dai Yinhua wrote: > Hi team, > > I am aware that akka cluster may be partitioned to 2 clusters with > auto-downing. > But I can't understand how does

Re: [akka-user] Re: Detail: akka.stream.StreamTcpException: Connection failed.

2017-02-27 Thread Viktor Klang
Are you consuming your response bodies? -- Cheers, √ On Feb 27, 2017 12:27 PM, "Chaitanya Mahipath" wrote: > Hi Johannes, > > I tried with Http.SingleRequest as suggested but could see the following > exception > > akka.stream.BufferOverflowException: Exceeded

Re: [akka-user] Akka Streams - Retry failed RPC call.

2017-02-24 Thread Viktor Klang
Hi Sean! There is a mistake and a misunderstanding in your code: object Test extends App { implicit val system = ActorSystem() implicit val mat = ActorMaterializer() val x: Future[Done] = Source(List("one", "two", "three")).map { value => val data = makeRPCcall(value)

Re: [akka-user] Akka Streams - Retry failed RPC call.

2017-02-23 Thread Viktor Klang
def downloadS3ObjectFlow(s3Client: S3Client, bucket: String): Flow[String, ByteString, NotUsed] = { Flow[String].flatMapConcat { key => log.debug(s"Downloading $key") val data: Source[ByteString, NotUsed] = s3Client.download(bucket, key) data.recoverWithRetries(3, {

Re: [akka-user] newbie question about await inside actors code

2017-02-21 Thread Viktor Klang
017 12:12, Viktor Klang wrote: > > http://doc.akka.io/docs/akka/2.4/scala/actors.html#Stash >> > > Ahah! I'd seen stash in the docs and not really come up with an case > (other than become/become) where it would be useful, and then forgotten > about it. I'm still not clear h

Re: [akka-user] newbie question about await inside actors code

2017-02-21 Thread Viktor Klang
http://doc.akka.io/docs/akka/2.4/scala/actors.html#Stash On Tue, Feb 21, 2017 at 1:09 PM, Alan Burlison <alan.burli...@gmail.com> wrote: > On 20/02/2017 12:01, Viktor Klang wrote: > > No. I'd recommend to use stashing, makes the cost explicit. >> > > Could

Re: [akka-user] newbie question about await inside actors code

2017-02-20 Thread Viktor Klang
No. I'd recommend to use stashing, makes the cost explicit. -- Cheers, √ On Feb 20, 2017 12:56 PM, "Alan Burlison" wrote: > > This is not a solution because it creates one new thread for every > blocker. > > In general I agree, but if the code has already aggregated

Re: [akka-user] What is the difference between using broadcasts and manually connecting shapes

2017-02-10 Thread Viktor Klang
What does the test output show? On Fri, Feb 10, 2017 at 5:30 AM, faiz halde wrote: > I wanted to know if there is any difference between the following two > scenarios > > val g = RunnableGraph.fromGraph(GraphDSL.create() { implicit builder: > GraphDSL.Builder[NotUsed] =>

Re: [akka-user] [Akka stream] Sink/source materialization

2017-02-08 Thread Viktor Klang
You mean like: Source.single(()).flatMapConcat(_ => yourFunction())? -- Cheers, √ On Feb 8, 2017 03:33, "hbf" wrote: > Heya everybody! > > I know that Akka Stream elegantly distinguishes *describing* a graph from > *materializing* a graph. > > When working on custom Akka Stream

Re: [akka-user] Persistent Graph Stage

2017-02-06 Thread Viktor Klang
Would it be more flexible with a `persistentBuffer` stage? On Mon, Feb 6, 2017 at 4:54 PM, Konrad Malawski < konrad.malaw...@lightbend.com> wrote: > Would you be up to implementing it? Otherwise I don't think there will be > much happening around this. > It could start out in

Re: [akka-user] Class cast exceptions in actors that return Future[Unit]

2017-02-01 Thread Viktor Klang
On Wed, Feb 1, 2017 at 10:51 AM, Alan Burlison <alan.burli...@gmail.com> wrote: > On 01/02/17 09:06, Viktor Klang wrote: > > You're welcome. A reminder that the actual error messages are very >> important to include. :) >> > > Yes, I consider my wrist to b

Re: [akka-user] Class cast exceptions in actors that return Future[Unit]

2017-02-01 Thread Viktor Klang
On Wed, Feb 1, 2017 at 2:55 AM, Alan Burlison wrote: > Ahah! I think you may of nailed it... Thanks! >> > > Indeed you did nail it - "thanks" doesn't come close as I'd looked at this > for so long that I'd gone completely snow-blind ;-) > You're welcome. A reminder that

Re: [akka-user] Class cast exceptions in actors that return Future[Unit]

2017-01-31 Thread Viktor Klang
I think the problem is that your responding with a scala.util.Success rather than a akka.actor.Status.Success. On Wed, Feb 1, 2017 at 12:20 AM, Alan Burlison <alan.burli...@gmail.com> wrote: > On 31/01/17 22:18, Viktor Klang wrote: > > The answer will be in the stack traces. &g

Re: [akka-user] Class cast exceptions in actors that return Future[Unit]

2017-01-31 Thread Viktor Klang
or > for example sends a Future[Unit] back, then you will have a > Future[Future[Unit]] returned from ask. > > -- > Johan > Akka Team > > On Tue, Jan 31, 2017 at 2:41 PM, Alan Burlison <alan.burli...@gmail.com> > wrote: > >> On 31/01/2017 21:36, Viktor

Re: [akka-user] Slf4jLoggingFilter/logback level filtering issue

2017-01-12 Thread Viktor Klang
run the app with -Dakka.log-config-on-start=on On Thu, Jan 12, 2017 at 11:15 AM, vacuumstate wrote: > Hi, > > I'm having trouble trying to get logging working as per standard akka > documentation. > > The application consists of several scala/sbt assembly jars deployed

Re: [akka-user] akka-http non-standard status codes

2017-01-04 Thread Viktor Klang
How about having that exception message suggest using the other factory method? -- Cheers, √ On Jan 4, 2017 7:14 PM, "Konrad Malawski" wrote: > Please read my response in detail: > Use the 4 parameter version: StatusCodes.custom(666, "BadStatusCode", "The >

Re: [akka-user] Streaming protobuf objects

2016-12-29 Thread Viktor Klang
Glad it worked out well for you! You'll want to put ` private var tail = ByteString.empty` inside the creation of th GraphStageLogic (otherwise your stage does not rematerialize properly) On Thu, Dec 29, 2016 at 11:10 AM, Leopoldo Müller wrote: > Kyrylo, > > As

Re: [akka-user] Akka stream never completes

2016-12-27 Thread Viktor Klang
eagerClose on the Merge? -- Cheers, √ On Dec 27, 2016 6:30 PM, "Sergey Sopin" wrote: > Hi all, > > > I am trying to build a flow, which will return CompletionStage with the > List inside. It looks like following: > > > private CompletionStage

Re: [akka-user] Completing request outside of main controller

2016-12-20 Thread Viktor Klang
I guess another option would be to spawn your own Promise and pass it in your messages and complete it where you want? -- Cheers, √ On Dec 20, 2016 10:40 AM, "Konrad Malawski" wrote: > Either of the two work. Use ask to integrate with the Actor. > > The complete

Re: [akka-user] Consistent Dissasociation, small cluster

2016-12-17 Thread Viktor Klang
Hi! Update to most recent version and report back. -- Cheers, √ On Dec 17, 2016 08:20, "Jordan Messec" wrote: > Hello, I am struggling with a problem I have spent days trying to resolve. > I was hoping someone here may have some input that could help me look in > the right

Re: [akka-user] akka streams graph is not fully drained when Future[Done] completes

2016-12-16 Thread Viktor Klang
Is this really a *minimized* reproducer? On Fri, Dec 16, 2016 at 11:09 PM, wrote: > Here's the code to reproduce. The issue only seems to occur with my custom > Source and using a callback in a Flow and while parallelizing. If this code > is run with

Re: [akka-user] akka streams graph is not fully drained when Future[Done] completes

2016-12-16 Thread Viktor Klang
Akka <http://akka.io> @ Lightbend <http://lightbend.com> > > On 16 December 2016 at 16:03:44, Viktor Klang (viktor.kl...@gmail.com) > wrote: > > Plase submit a miminized reproducer so readers have a chance of running > the code. > > On Fri, Dec 16, 2016 at 3

Re: [akka-user] akka streams graph is not fully drained when Future[Done] completes

2016-12-16 Thread Viktor Klang
Plase submit a miminized reproducer so readers have a chance of running the code. On Fri, Dec 16, 2016 at 3:44 PM, wrote: > Hi, > > I'm seeing an issue where the graph completes while there is still data in > one of the flows. The last element emitted by the source enters a

Re: [akka-user] What's wrong with value classes as parameters?

2016-12-15 Thread Viktor Klang
You missed that they are value classes. ;) Try: val valueRef = system.actorOf { Props(classOf[ValueActor], 10) } On Thu, Dec 15, 2016 at 8:28 AM, Dmb wrote: > I'm reading the documentation > about >

Re: [akka-user] Unit test for Persistent Actor Replay

2016-12-01 Thread Viktor Klang
Good question! The notification of its death hadn't reached the closest of kin (its parent) so they hadn't even put it in the ground when you proposed to create a new one and call it the same thing, so they (rightfully so) objected to that suggestion. This trips people up every now and then, but

Re: [akka-user] UnboundedMailbox - One at a Time?

2016-11-28 Thread Viktor Klang
Hi Kevin, this is explained in the following section: http://doc.akka.io/docs/akka/2.4/general/jmm.html#Futures_and_the_Java_Memory_Model On Mon, Nov 28, 2016 at 8:58 PM, Kevin Meredith wrote: > Thanks, Viktor, for that link. > > So, in the following: > >1.

Re: [akka-user] UnboundedMailbox - One at a Time?

2016-11-28 Thread Viktor Klang
Hi Kevin, have you read this: http://doc.akka.io/docs/akka/2.4/general/jmm.html ? On Mon, Nov 28, 2016 at 8:44 PM, Kevin Meredith wrote: > Looking at the Mailboxes > > docs,

Re: [akka-user] Akka streams - tripped up by buffers

2016-11-28 Thread Viktor Klang
Sorry for the late response, sounds like you found a solution to your problem! On Wed, Nov 23, 2016 at 12:34 PM, Julian Howarth <10.howa...@gmail.com> wrote: > Is there any value in this approach for anyone else? Quite happy to raise > issues/PR if there is. > > Thanks, > > Julian > > > On

Re: [akka-user] Line count of each file in a given directory efficiently using akka

2016-11-23 Thread Viktor Klang
Your use-case sounds like a perfect example of something which would benefit quite a bit from being based on Akka Streams. On Wed, Nov 23, 2016 at 11:25 AM, kk k wrote: > > This is my first program in akka so I wanted to know if the below program > is efficient and is

Re: [akka-user] Understanding scala.concurrent.Await#result

2016-11-22 Thread Viktor Klang
scala> def fut = { | Thread.sleep(5000) | Future(42) | } fut: scala.concurrent.Future[Int] scala> Await.result( fut, FiniteDuration(1, SECONDS) ) res1: Int = 42 The code above is equivalent of: Thread.sleep(5000) val anon = Future(42) Await.result(anon, FiniteDuration(1,

Re: [akka-user] Future#mapTo versus Future.successful#mapTo?

2016-11-21 Thread Viktor Klang
On Mon, Nov 21, 2016 at 5:23 PM, Kevin Meredith wrote: > Given: > > $scala > Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java > 1.8.0_101). > Type in expressions for evaluation. Or try :help. > > import scala.concurrent.Future > import

Re: [akka-user] Illegal Authorization Header

2016-11-16 Thread Viktor Klang
What does the RFC say about allowed characters in headers? -- Cheers, √ On Nov 16, 2016 20:52, wrote: > Hi, > > I am using akka-http in which I have implemented a custom authorization > scheme (based on AWS' auth) which takes the header form "Authorization: > CSTM

Re: [akka-user] Akka streams - tripped up by buffers

2016-11-16 Thread Viktor Klang
On Wed, Nov 16, 2016 at 2:24 PM, Julian Howarth <10.howa...@gmail.com> wrote: > > On Wednesday, November 16, 2016 at 11:04:55 AM UTC, √ wrote: >> >> How would auxiliary stages know which index the accumulation started at? >> > > That's where I was hoping an appropriate buffer stage could help, by

Re: [akka-user] Akka streams - tripped up by buffers

2016-11-16 Thread Viktor Klang
How would auxiliary stages know which index the accumulation started at? On Wed, Nov 16, 2016 at 12:02 PM, Julian Howarth <10.howa...@gmail.com> wrote: > Thanks Viktor, > > But as I said, I don't have access to change the accumulator flow - it's a > black box that I otherwise would have to

Re: [akka-user] Akka streams - tripped up by buffers

2016-11-16 Thread Viktor Klang
val accumulator = Flow[Int] .statefulMapConcat { () ⇒ var total = 0 var curIdx = 0L var startIdx = curIdx i ⇒ { val newTotal = total + i if (newTotal >= 10) { val result = List((newTotal, startIdx)) curIdx += 1 startIdx =

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Viktor Klang
Hi Alexandre, perhaps if you describe what you are trying to do, then the readers can suggest different solutions which might fit the use case? On Fri, Nov 11, 2016 at 12:43 PM, Alexandre Masselot < alexandre.masse...@gmail.com> wrote: > > Thanks √ , > Your feedback makes real sense. But I'm

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Viktor Klang
Because in your actor example you're confusing the materialization of one flow with the returning of another. On Fri, Nov 11, 2016 at 11:29 AM, Alexandre Masselot < alexandre.masse...@gmail.com> wrote: > Hello, > > I'm a bit stuck and seeking for help;) > A play controller should be producing

Re: [akka-user] Akka-remoting with Artery using load balancing/round robbing dns

2016-11-10 Thread Viktor Klang
Consider that confirmed then. ;) On Thu, Nov 10, 2016 at 5:12 PM, wrote: > Ok. Just wanted that confirmed. We already have a workaround for it so I > was mostly just curious to see if it was needed :). > > / Johan > > > > Den torsdag 10 november 2016 kl.

Re: [akka-user] Akka-remoting with Artery using load balancing/round robbing dns

2016-11-10 Thread Viktor Klang
the host needs to be a stable identifier. What problem are you trying to solve with the rr dns? On Thu, Nov 10, 2016 at 10:48 AM, wrote: > Case: > > I have two services (A and B) that wish to talk to each other using > akka-remoting over artery. > Each

Re: [akka-user] Akka-remote docker<->docker works fine with netty.tcp, but fails with artery - ideas?

2016-11-09 Thread Viktor Klang
looks related -- Cheers, √ On Nov 9, 2016 20:13, wrote: > Well, host <-> docker container artery works (both permutations). It's > just docker <-> docker on the same host that doesn't. > So udp forwarding seems to work. I will try to figure out a

Re: [akka-user] Re: Akka-stream - aggregate record counts while writing to a sink, and update an object in the middle of the flow process with the aggregated data.

2016-11-04 Thread Viktor Klang
Why would it need its own materializer? On Fri, Nov 4, 2016 at 1:26 PM, Eugene Dzhurinsky wrote: > More I think about is - more I am convinced that this is something that > must be implemented via nested flows, like - the step to extract the > initial user profile and then

Re: [akka-user] Akka Streams - output CSV - how to know last line so can avoid appending new line character

2016-10-31 Thread Viktor Klang
You're most welcome. On Mon, Oct 31, 2016 at 2:49 PM, Gary Malouf <malouf.g...@gmail.com> wrote: > Ah - missed that in the API - thanks for the pointer! > > On Mon, Oct 31, 2016 at 9:47 AM, Viktor Klang <viktor.kl...@gmail.com> > wrote: > >> intersperse? >

Re: [akka-user] Akka Streams - output CSV - how to know last line so can avoid appending new line character

2016-10-31 Thread Viktor Klang
intersperse? On Mon, Oct 31, 2016 at 2:40 PM, Gary Malouf wrote: > I am attempting to use Akka streams to read a large amount of data from a > database (in chunks) and output to a CSV on S3. While it may seem trivial, > I'm trying to find the best way to identify the

Re: [akka-user] Some remote nodes not joining the cluster

2016-10-30 Thread Viktor Klang
Are the hostnames properly configured/DNS:ed? -- Cheers, √ On Oct 30, 2016 4:45 PM, "Patrik Nordwall" wrote: > The order should not matter. It will retry. > > Firewall rules can be unidirectional and then it matters in which > direction the connection is

Re: [akka-user] Abstracting away CommitableMessage

2016-10-26 Thread Viktor Klang
se CommitableMessages all the way through. > So I think I may need something like a nested flow (the "job") in a stage > that hangs onto the current CommitableMessage. > > > On Wed, Oct 26, 2016 at 9:23 AM, Viktor Klang <viktor.kl...@gmail.com> > wrote:

Re: [akka-user] Abstracting away CommitableMessage

2016-10-26 Thread Viktor Klang
what would happen if that stage would silently discard the CommittableMessage? -- Cheers, √ On Oct 26, 2016 6:09 PM, "Richard Rodseth" wrote: > I'm planning to use a commitableSource from akka-streams-kafka. > > Is there a way to re-use an existing Flow that knows nothing

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Viktor Klang
On Wed, Oct 19, 2016 at 2:43 PM, Alexey Shuksto wrote: > 1. Flow itself is a bidi-codec from ByteString to our own Request/Response > entities. Each Request has Promise[Response] attribute. Shared state is > more like Map[Request.Id, Promise[Response]] -- because order of

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Viktor Klang
On Wed, Oct 19, 2016 at 2:18 PM, Alexey Shuksto wrote: > 2 Konrad: Yep, in original question I meant not 'DSL construction time' > but 'execution time' thread-safety. Thanks for clarification. > > 2 Victor: Use case is simple: outgoing flow need to store `Promise` of > future

Re: [akka-user] Is contents of GraphDSL.create() {..} thread-safe for BidiFlow?

2016-10-19 Thread Viktor Klang
Hi Alexey, Not only is it not thread-safe, but it also actively prevents multiple materializations. Perhaps if you state your use-case we can suggest an alternative? On Wed, Oct 19, 2016 at 1:24 PM, Alexey Shuksto wrote: > Hello hAkkers, > > Simple example: > val zipper =

Re: [akka-user] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread Viktor Klang
Hi Regis, unfortunately you're still doing unsafe things (you have a race-condition in your accesses to bufferedElement) On Fri, Oct 14, 2016 at 3:56 PM, regis leray wrote: > Thanks a lot i succeed, to make it work... > > val switch = new ValveSwitch { > val callback =

Re: [akka-user] Re: What's the replacement for Akka Actor Publisher and Subscriber?

2016-10-13 Thread Viktor Klang
RS Backpressure can piggyback on top of TCP, which means HTTP, WebSocket and HTTP/2 support. Besides that there's *tons* of integrations (Sources and Sinks) for networked components. As if that wasn't enough there's both the ReactiveSocket initiative ( http://reactivesocket.io/) as well as Apache

Re: [akka-user] Missing api GraphStageLogic

2016-10-13 Thread Viktor Klang
by default scaladoc only shows public members and the methods you are speaking of are protected, so you need to click "All" -- Cheers, √ On Oct 13, 2016 8:37 AM, "Ortigali Bazarov" wrote: > In documentation, there is a example how to use GraphStageLogic's pull, >

Re: [akka-user] How to handle web socket message to upload base64 encoded string of 10mb file

2016-10-11 Thread Viktor Klang
You're most welcome! :) On Tue, Oct 11, 2016 at 5:52 PM, Rafał Krzewski wrote: > Right, thanks :) > > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >>

Re: [akka-user] How to handle web socket message to upload base64 encoded string of 10mb file

2016-10-11 Thread Viktor Klang
Use: Future.successful(text) iso `Future(text)` (no need to evaluate it asynchronously) On Tue, Oct 11, 2016 at 3:58 PM, Rafał Krzewski wrote: > In my particular application the messages I'm receiving a few kB in size. > Sometimes they arrive as Strict and sometimes as

Re: [akka-user] Re: [akka-streams] Debug of custom stream processing logic

2016-10-11 Thread Viktor Klang
happy hakking! :) On Tue, Oct 11, 2016 at 11:19 AM, Sergey Sopin wrote: > Yep, thanks! > > -- > >> Read the docs: http://akka.io/docs/ > >> Check the FAQ: http://doc.akka.io/docs/akka/ > current/additional/faq.html > >> Search the archives:

Re: [akka-user] Re: [akka-streams] Debug of custom stream processing logic

2016-10-11 Thread Viktor Klang
Akka Streams are executed concurrently. I'm not sure breakpoints make much sense in this case. On Tue, Oct 11, 2016 at 10:16 AM, Sergey Sopin wrote: > Hi, > > The question is still valid :) > > Thanks. > > -- > >> Read the docs: http://akka.io/docs/ > >>

Re: [akka-user] Re: onUpstreamFinish not getting called

2016-10-07 Thread Viktor Klang
Can you post a minimal reproducer? On Fri, Oct 7, 2016 at 9:02 PM, Eric Swenson wrote: > I wrote a simple test for my CipherStage and it appears to work fine: > > "CipherStage" should "work" in { > val clearText = "0123456789abcdef" > val clearSource =

Re: [akka-user] Akka HTTP complete Future obtained from ask, with custom marshalling

2016-10-07 Thread Viktor Klang
If you know the type of the expected response from the ask, then you use `mapTo` on the returned Future to coerce it. On Fri, Oct 7, 2016 at 5:55 PM, Richard Rodseth wrote: > Continuing my struggles to port something we did with Spray, using > > // See

Re: [akka-user] Sending response back to sender from remote routee

2016-10-07 Thread Viktor Klang
happy hakking! On Fri, Oct 7, 2016 at 4:50 PM, Jegan wrote: > Thanks friends. I tried the options suggested by both of you. Both are > working great. > > On Friday, October 7, 2016 at 7:23:05 AM UTC-7, √ wrote: >> >> pipeTo >> >> On Fri, Oct 7, 2016 at 4:17 PM, Justin du

Re: [akka-user] Sending response back to sender from remote routee

2016-10-07 Thread Viktor Klang
pipeTo On Fri, Oct 7, 2016 at 4:17 PM, Justin du coeur wrote: > This is kind of the number-one FAQ for Akka: you must never, ever use > "sender" in the results of a Future. "sender" is only set *synchronously*, > while the receive method is running -- after that (in your

Re: [akka-user] Re: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
dispatcher has ~30 threads >> >> -- >> Cheers, >> √ >> >> On Oct 6, 2016 10:03, "Viktor Klang" <viktor...@gmail.com> wrote: >> >>> Of course it builds up if you can't process the messages equal-or-faster >>> than you get them? >&

Re: [akka-user] Re: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
Of course it builds up if you can't process the messages equal-or-faster than you get them? -- Cheers, √ On Oct 6, 2016 09:49, "Alexander Lukyanchikov" < alexanderlukyanchi...@gmail.com> wrote: > > Sorry guys, quick update: > > Time interval actually affects the situation: if actor job time <

Re: [akka-user] Re: Memory leak: unexpected mailbox filling up

2016-10-06 Thread Viktor Klang
My guess is that your default dispatcher has ~30 threads -- Cheers, √ On Oct 6, 2016 10:03, "Viktor Klang" <viktor.kl...@gmail.com> wrote: > Of course it builds up if you can't process the messages equal-or-faster > than you get them? > > -- > Cheers, > √ &g

  1   2   3   4   5   6   >