Re: [akka-user] Cancel Actor job

2018-02-08 Thread Johan Andrén
I'm afraid we haven't gotten to porting it to Java yet. -- Johan On Monday, February 5, 2018 at 8:40:03 AM UTC+1, Richard Gong wrote: > > Thanks Johan. It looks very good. Is there any Java version? I found one > on git hub: > https://github.com/typesafehub/activator-akka-distributed-workers-ja

Re: [akka-user] Cancel Actor job

2018-02-04 Thread Richard Gong
Thanks Johan. It looks very good. Is there any Java version? I found one on git hub: https://github.com/typesafehub/activator-akka-distributed-workers-java, yet it's an old version 2 years ago and the api being used are obsoleted. > > -- >> Read the docs: http://akka.io/docs/

Re: [akka-user] Cancel Actor job

2018-02-02 Thread Akka Team
Maybe this distributed workers guide could be good inspiration: https://developer.lightbend.com/guides/akka-distributed-workers-scala/ -- Johan Akka Team On Fri, Feb 2, 2018 at 3:10 AM, Konrad “ktoso” Malawski < konrad.malaw...@lightbend.com> wrote: > Have a look at "cluster sharding”, it’s smar

Re: [akka-user] Cancel Actor job

2018-02-01 Thread Konrad “ktoso” Malawski
Have a look at "cluster sharding”, it’s smarter than just routers. -- Cheers, Konrad 'ktoso ' Malawski Akka @ Lightbend On February 2, 2018 at 11:09:19, Richard Gong (gong...@gmail.com) wrote: That works in a single machine. Now take a st

Re: [akka-user] Cancel Actor job

2018-02-01 Thread Richard Gong
That works in a single machine. Now take a step forward to have the workers in a cluster. The master needs to dispatch jobs to workers. I'm looking at the document of router, https://doc.akka.io/docs/akka/current/cluster-usage.html?language=scala#router-with-pool-of-remote-deployed-routees. M

Re: [akka-user] Cancel Actor job

2018-01-25 Thread Konrad “ktoso” Malawski
Actors may not be that cheap. They are ~400 bytes for an Actor; plus whatever you put inside one of course, but that’s your state, not the Actor’s fault ;) I tried to create a worker actor every time the master actor received a start job message and found out that it created a new thread to run i

Re: [akka-user] Cancel Actor job

2018-01-25 Thread Richard Gong
Actors may not be that cheap. I tried to create a worker actor every time the master actor received a start job message and found out that it created a new thread to run it. Seems to me that the default dispatcher is an unbounded thread pool. It doesn't look good to me -- it falls back to the t

Re: [akka-user] Cancel Actor job

2018-01-25 Thread Konrad Malawski
Actors are cheap so you can start one actor (make them child actors if some actor that manages the work things), so then you don’t have that multiplexing issue at all. Remember to put the blocking things onto a dedicated thread pool dispatcher — read docs about dealing with blocking to see how --

[akka-user] Cancel Actor job

2018-01-25 Thread Richard Gong
I'm newbie in Akka. Here's one thing I'm trying to achieve, a simple job manager. There are jobs involving SQL queries and CPU intended computation. The jobs should be cancellable while they're running. Here's my code to simulate it. The worker actor sends "continue" message to itself if no can