Thank you in advance.Mic--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/1d4UMkNW8UQJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
Hi Mic,
Thank you in advance.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
Hi Mic,
Thank you in advance.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
Hi Mic,
Thank you in advance.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
In order to execute callbacks and operations, Futures need something called an ExecutionContext, which is very similar to a java.util.concurrent.Executor. if you have an ActorSystem in scope, it will use its default dispatcher as the ExecutionContext, or you can use the factory methods provided by the ExecutionContextcompanion object to wrap Executors and ExecutorServices, or even create your own.
- import akka.dispatch.{ ExecutionContext, Promise }
- implicit val ec = ExecutionContext.fromExecutorService(yourExecutorServiceGoesHere)
- // Do stuff with your brand new shiny ExecutionContext
- val f = Promise.successful("foo")
- // Then shut your ExecutionContext down at some
- // appropriate place in your program/application
- ec.shutdown()
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/FOazw6cJVpgJ.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/f-2AIM4QU_EJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
Hi Viktor,Thank you. How to improve the output from the following code:
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/kxwpgm6EPNgJ.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/nxeatUyc_G0J.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
Hi Roland,I tried it out unsuccessful with the following code:import akka.dispatch.{Future, ExecutionContext}import akka.util.duration._import java.util.concurrent.Executorsobject Communication {def main(args: Array[String]) {implicit val ec = ExecutionContext.fromExecutorService(Executors.newCachedThreadPool());// send tasks to the dispatherval results = Future.traverse(List.range(0,10)){i =>Future("%d x %d = %d" format (i, i, i*i))} map(_.mkString("\n")) println andThen { case _ => ec.shutdown }}}What did I do wrong?