You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue occurs when an actor sends a message using !? in certain scenarios. One example is given in the code.
An unhandled timeput exception is thrown in the following code. See screenshot of the run.
package test
import scala.actors.Actor
object Run {
def main(args: Array[String]) = { while (true) {A1 ! 1; Thread.sleep(1000) } }
}
object A2 extends Actor {
this.start
def act = loop { react { case _ => } }
}
object A1 extends Actor {
this.start
def act = loop { react { case any => A2 !? (1000, any) } }
}
Save above code into a file test.scala and use following to run: Assume Scala 2.9.0.1 is installed in C:\scala-2.9.0.1
Exception thrown is:
{noformat}
test.A1$@785f8172: caught java.lang.RuntimeException: unhandled timeout
java.lang.RuntimeException: unhandled timeout
at scala.sys.package$.error(package.scala:27)
at scala.actors.Actor$class.receiveWithin(Actor.scala:606)
at test.A1$.receiveWithin(test.scala:10)
at scala.actors.Channel.receiveWithin(Channel.scala:71)
at scala.actors.ActorCanReply$class.$bang$qmark(ActorCanReply.scala:32)
at test.A2$.$bang$qmark(test.scala:6)
at test.A1$$anonfun$act$2$$anonfun$apply$2.apply(test.scala:12)
at test.A1$$anonfun$act$2$$anonfun$apply$2.apply(test.scala:12)
at scala.actors.ReactorTask.run(ReactorTask.scala:31)
at scala.actors.ReactorTask.compute(ReactorTask.scala:63)
at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:147)
at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325){noformat}
The text was updated successfully, but these errors were encountered:
The issue occurs when an actor sends a message using !? in certain scenarios. One example is given in the code.
An unhandled timeput exception is thrown in the following code. See screenshot of the run.
Save above code into a file test.scala and use following to run: Assume Scala 2.9.0.1 is installed in C:\scala-2.9.0.1
Exception thrown is:
{noformat}
test.A1$@785f8172: caught java.lang.RuntimeException: unhandled timeout
java.lang.RuntimeException: unhandled timeout
at scala.sys.package$.error(package.scala:27)
at scala.actors.Actor$class.receiveWithin(Actor.scala:606)
at test.A1$.receiveWithin(test.scala:10)
at scala.actors.Channel.receiveWithin(Channel.scala:71)
at scala.actors.ActorCanReply$class.$bang$qmark(ActorCanReply.scala:32)
at test.A2$.$bang$qmark(test.scala:6)
at test.A1$$anonfun$act$2$$anonfun$apply$2.apply(test.scala:12)
at test.A1$$anonfun$act$2$$anonfun$apply$2.apply(test.scala:12)
at scala.actors.ReactorTask.run(ReactorTask.scala:31)
at scala.actors.ReactorTask.compute(ReactorTask.scala:63)
at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:147)
at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325){noformat}
The text was updated successfully, but these errors were encountered: