Question in a nutshell:
My Akka Actor creates a Future using the macro Future{someBlockingCall}
within it's receive method.
Inside someBlockingCall, I throw an exception. This does not trigger a
supervisor in the parent. How can get the future to trigger a parent
supervisor restart?
In MyBatchReader, I have tested two places to throw exceptions:
class MyBatchReader extends Actor{
Hi all,
I've got a question in relation to the unit testing of a piece of non actor
code that produces a Future via performing an
actorSelection().resolveOne on the ActorSystem.
Within the Future.onFailure() a value is being set that I would like to
test but the Future is making use of the ActorSystem.dispatcher() which is
therefore causing asynchronicity issues when attempting to Assert
Hello,
I have some strange behavior that I can't explain.
I have a router like this:
class MyRouter extends Actor{
val myRouter = context.actorOf( Props[MyBatchReader].withRouter( FromConfig()), name="myRouter")
def receive = {
case Read( id:String ) =>
myRouter ! Read( id )
case x =>
println( "MyRouter Got Unknown {}", x )
}
}
Is there a way to delay the execution (not the completion) of a future,
similar to the scheduleOnce method for actors? I tried this:
Future delayedString = Patterns.after(new FiniteDuration(10, TimeUnit.SECONDS),
system.scheduler(), system.dispatcher(), Futures.future(new Callable() {
public String call() throws Exception {
System.out.println("Returning
I'm currently trying to track down some very strange behavior in my actor
which is probably a race condition. What I'm basically doing is to create
actor children, use context.watch for each created child and put the
ActorRef from actorOf into a map along with other data associated with the
actor. Upon receiving a Terminated message I'm using the provided ActorRef
as key for the map lookup
Hi, all,
I've been upgrading BlueEyes to Akka 2.0, and I'm having some trouble ensuring that various actor queues are flushed before a server shuts down. Under akka 1.x, I could ensure that a queue was flushed by simply sending the actor a PoisonPill using the 'ask' style, and recover the resulting future. This seems to no longer work properly. What am I doing wrong? Here's an example of what I'm
I have a server, which on the one hand needs to send data and on the other
hands needs to receive data. So far I was unable to implement this.
The only code example, which I found, is this:
val tcpFlow = Tcp().outgoingConnection(host, port)
val bytes: IndexedSeq[ByteString] = ???
val resp = Source(bytes).via(tcpFlow).runFold(ByteString.empty)(_++_)
resp onComplete { ... }
I don
hi,
i need to start JVM in the akka actor as below.
object TestActor {
def main(args:Array[String]) = {
val system = ActorSystem("TestActorSystem")
val requestActor = system.actorOf(Props(classOf[TestActor]), "request-actor")
val request = "this is request message"
println("TestActor => main => send request : " + request)
////requestActor ! RequestMessage(request
I sometimes run into cases where I instantiate a child actor ,then subsequently ask that child with a message, only to discover that the ask became dead letter due to the child not been initialized yet. I guess my mistake is to apply a synchronous mindset instead of realizing that the child actor creation happens asynchronously, and I could avoid this by passing in a constructor parameter to the
Howdy, all! I originally talked up the Requester pattern a year or two
ago, when I had just started playing with it seriously. It's now matured
quite a bit and become rather more complete, and is being used heavily in
production for Querki. And since I've gotten used to releasing open-source
libraries for Scala.js, I figure it's time to make Requester more generally
available.
Full details