Hello, I am not able to compile the AKKA 2 example http://doc.akka.io/docs/akka/2.0/scala/futures.html#Use_Directly * * *import akka.dispatch.Await* *import akka.dispatch.Future* *import akka.util.duration._* * * * * *object HelloWorldFuture {* * def main(args: Array[String]) {* * val future = Future {* * "Hello" + "World"* * }* * val result = Await.result(future, 1 second)* * }* *} *
$ fsc -cp ../jars/akka/lib/akka/akka-actor-2.0.1.jar:. HelloWorldFuture.scala HelloWorldFuture.scala:8: error: could not find implicit value for parameter executor: akka.dispatch.ExecutionContext val future = Future { ^ one error found
> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:.
> HelloWorldFuture.scala
> HelloWorldFuture.scala:8: error: could not find implicit value for
> parameter executor: akka.dispatch.ExecutionContext
> val future = Future {
> ^
> one error found
> --
> 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-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
>> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:. >> HelloWorldFuture.scala
>> HelloWorldFuture.scala:8: error: could not find implicit value for >> parameter executor: akka.dispatch.ExecutionContext
>> val future = Future {
>> ^
>> one error found
>> -- >> 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-user@googlegroups.com.
>> To unsubscribe from this group, send email to >> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/akka-user?hl=en.
On Sunday, May 6, 2012 10:05:18 PM UTC+10, √ wrote:
> Hi Mic,
> On Sun, May 6, 2012 at 11:42 AM, Mic <micta...@gmail.com> wrote:
>> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:. >> HelloWorldFuture.scala
>> HelloWorldFuture.scala:8: error: could not find implicit value for >> parameter executor: akka.dispatch.ExecutionContext
>> val future = Future {
>> ^
>> one error found
>> -- >> 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-user@googlegroups.com.
>> To unsubscribe from this group, send email to >> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/akka-user?hl=en.
On Sunday, May 6, 2012 10:05:18 PM UTC+10, √ wrote:
> Hi Mic,
> On Sun, May 6, 2012 at 11:42 AM, Mic <micta...@gmail.com> wrote:
>> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:. >> HelloWorldFuture.scala
>> HelloWorldFuture.scala:8: error: could not find implicit value for >> parameter executor: akka.dispatch.ExecutionContext
>> val future = Future {
>> ^
>> one error found
>> -- >> 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-user@googlegroups.com.
>> To unsubscribe from this group, send email to >> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/akka-user?hl=en.
If you tell me which part of the following you do not understand, then I'll
try to elaborate:
"Execution Contexts
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.
1. import akka.dispatch.{ ExecutionContext, Promise }
2.
3. implicit val ec =
ExecutionContext.fromExecutorService(yourExecutorServiceGoesHere)
4.
5. // Do stuff with your brand new shiny ExecutionContext
6. val f = Promise.successful("foo")
7.
8. // Then shut your ExecutionContext down at some
9. // appropriate place in your program/application
10. ec.shutdown()
On Sun, May 6, 2012 at 2:13 PM, Mic <micta...@gmail.com> wrote:
> Hi Vic,
> I read the docs and the example is from the docs, but unfortunately I did
> not understand the docs.
> Mic
> On Sunday, May 6, 2012 10:05:18 PM UTC+10, √ wrote:
>> Hi Mic,
>> On Sun, May 6, 2012 at 11:42 AM, Mic <micta...@gmail.com> wrote:
>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act**or-2.0.1.jar:.
>>> HelloWorldFuture.scala
>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>> parameter executor: akka.dispatch.ExecutionContext
>>> val future = Future {
>>> ^
>>> one error found
>>> --
>>> 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<https://groups.google.com/d/msg/akka-user/-/1d4UMkNW8UQJ>
>>> .
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
> On Sunday, May 6, 2012 10:05:18 PM UTC+10, √ wrote:
>> Hi Mic,
>> On Sun, May 6, 2012 at 11:42 AM, Mic <micta...@gmail.com> wrote:
>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act**or-2.0.1.jar:.
>>> HelloWorldFuture.scala
>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>> parameter executor: akka.dispatch.ExecutionContext
>>> val future = Future {
>>> ^
>>> one error found
>>> --
>>> 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<https://groups.google.com/d/msg/akka-user/-/1d4UMkNW8UQJ>
>>> .
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
> On Sunday, May 6, 2012 10:05:18 PM UTC+10, √ wrote:
>> Hi Mic,
>> On Sun, May 6, 2012 at 11:42 AM, Mic <micta...@gmail.com> wrote:
>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act**or-2.0.1.jar:.
>>> HelloWorldFuture.scala
>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>> parameter executor: akka.dispatch.ExecutionContext
>>> val future = Future {
>>> ^
>>> one error found
>>> --
>>> 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<https://groups.google.com/d/msg/akka-user/-/1d4UMkNW8UQJ>
>>> .
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale
On Sunday, May 6, 2012 7:42:12 PM UTC+10, Mic wrote:
> Hello, > I am not able to compile the AKKA 2 example > http://doc.akka.io/docs/akka/2.0/scala/futures.html#Use_Directly > * > * > *import akka.dispatch.Await* > *import akka.dispatch.Future* > *import akka.util.duration._* > * > * > * > * > *object HelloWorldFuture {* > * def main(args: Array[String]) {* > * val future = Future {* > * "Hello" + "World"* > * }* > * val result = Await.result(future, 1 second)* > * }* > *} *
> $ fsc -cp ../jars/akka/lib/akka/akka-actor-2.0.1.jar:. > HelloWorldFuture.scala > HelloWorldFuture.scala:8: error: could not find implicit value for > parameter executor: akka.dispatch.ExecutionContext > val future = Future { > ^ > one error found
>> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:.
>> HelloWorldFuture.scala
>> HelloWorldFuture.scala:8: error: could not find implicit value for
>> parameter executor: akka.dispatch.ExecutionContext
>> val future = Future {
>> ^
>> one error found
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale
Hi Viktor,
Thank you. How to improve the output from the following code:
import akka.dispatch.{Future, ExecutionContext} import akka.util.duration._ import java.util.concurrent.Executors
object Communication {
def main(args: Array[String]) {
implicit val ec = ExecutionContext.fromExecutorService(
Executors.newCachedThreadPool()); // send tasks to the dispather
val results = Future.traverse(List.range(0,10)){i => Future("%d x %d = %d" format (i, i, i*i))
} map println andThen { case _ => ec.shutdown }
}
}
Current OUTPUT:
List(0 x 0 = 0, 1 x 1 = 1, 2 x 2 = 4, 3 x 3 = 9, 4 x 4 = 16, 5 x 5 = 25, 6 x 6 = 36, 7 x 7 = 49, 8 x 8 = 64, 9 x 9 = 81)
>>> $ fsc -cp ../jars/akka/lib/akka/akka-**actor-2.0.1.jar:. >>> HelloWorldFuture.scala
>>> HelloWorldFuture.scala:8: error: could not find implicit value for >>> parameter executor: akka.dispatch.ExecutionContext
>>> val future = Future {
>>> ^
>>> one error found
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to >> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/akka-user?hl=en.
> -- > Viktor Klang
> Akka Tech Lead
> Typesafe <http://www.typesafe.com/> - The software stack for applications > that scale
>>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act**or-2.0.1.jar:.
>>>> HelloWorldFuture.scala
>>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>>> parameter executor: akka.dispatch.ExecutionContext
>>>> val future = Future {
>>>> ^
>>>> one error found
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
>> --
>> Viktor Klang
>> Akka Tech Lead
>> Typesafe <http://www.typesafe.com/> - The software stack for
>> applications that scale
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale
Hi Viktor,
I am sorry. I meant to get something like this:
0 x 0 = 0
1 x 1 = 1
2 x 2 = 4
3 x 3 = 9
4 x 4 = 16
5 x 5 = 25
6 x 6 = 36
7 x 7 = 49
8 x 8 = 64
9 x 9 = 81
>>>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act**or-2.0.1.jar:. >>>>> HelloWorldFuture.scala
>>>>> HelloWorldFuture.scala:8: error: could not find implicit value for >>>>> parameter executor: akka.dispatch.ExecutionContext
>>>>> val future = Future {
>>>>> ^
>>>>> one error found
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>> For more options, visit this group at http://groups.google.com/** >>>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
>>> -- >>> Viktor Klang
>>> Akka Tech Lead
>>> Typesafe <http://www.typesafe.com/> - The software stack for >>> applications that scale
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to >> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at >> http://groups.google.com/group/akka-user?hl=en.
> -- > Viktor Klang
> Akka Tech Lead
> Typesafe <http://www.typesafe.com/> - The software stack for applications > that scale
> Hi Viktor,
> I am sorry. I meant to get something like this:
> 0 x 0 = 0
> 1 x 1 = 1
> 2 x 2 = 4
> 3 x 3 = 9
> 4 x 4 = 16
> 5 x 5 = 25
> 6 x 6 = 36
> 7 x 7 = 49
> 8 x 8 = 64
> 9 x 9 = 81
> Cheers,
> Mic
> On Monday, May 7, 2012 9:53:47 AM UTC+10, √ wrote:
> Hi Mic,
> On Mon, May 7, 2012 at 1:49 AM, Mic <micta...@gmail.com> wrote:
> Hi Viktor,
> Thank you. How to improve the output from the following code:
> How do I improve something without being given a metric?
> $ fsc -cp ../jars/akka/lib/akka/akka-actor-2.0.1.jar:. HelloWorldFuture.scala
> HelloWorldFuture.scala:8: error: could not find implicit value for parameter executor: akka.dispatch.ExecutionContext
> val future = Future {
> ^
> one error found
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
> -- > Viktor Klang
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
> -- > Viktor Klang
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
> Twitter: @viktorklang
> -- > 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/-/nxeatUyc_G0J.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn
Hi Roland,
I tried it out unsuccessful with the following code:
import akka.dispatch.{Future, ExecutionContext}
import akka.util.duration._
import java.util.concurrent.Executors
object Communication {
def main(args: Array[String]) {
implicit val ec = ExecutionContext.fromExecutorService(
Executors.newCachedThreadPool());
// send tasks to the dispather
val 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 }
> Hi Viktor,
> I am sorry. I meant to get something like this:
> 0 x 0 = 0
> 1 x 1 = 1
> 2 x 2 = 4
> 3 x 3 = 9
> 4 x 4 = 16
> 5 x 5 = 25
> 6 x 6 = 36
> 7 x 7 = 49
> 8 x 8 = 64
> 9 x 9 = 81
> Cheers,
> Mic
> On Monday, May 7, 2012 9:53:47 AM UTC+10, √ wrote:
>> Hi Mic,
>> On Mon, May 7, 2012 at 1:49 AM, Mic <micta...@gmail.com> wrote:
>>> Hi Viktor,
>>> Thank you. How to improve the output from the following code:
>> How do I improve something without being given a metric?
>>>>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act****or-2.0.1.jar:.
>>>>>> HelloWorldFuture.scala
>>>>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>>>>> parameter executor: akka.dispatch.ExecutionContext
>>>>>> val future = Future {
>>>>>> ^
>>>>>> one error found
>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>>>> googlegr**oups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>>> For more options, visit this group at http://groups.google.com/**group >>>>> **/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
>>>> --
>>>> Viktor Klang
>>>> Akka Tech Lead
>>>> Typesafe <http://www.typesafe.com/> - The software stack for
>>>> applications that scale
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>> For more options, visit this group at http://groups.google.com/** >>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
>> --
>> Viktor Klang
>> Akka Tech Lead
>> Typesafe <http://www.typesafe.com/> - The software stack for
>> applications that scale
>> Twitter: @viktorklang
> --
> 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/-/nxeatUyc_G0J.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
On Mon, May 7, 2012 at 3:33 PM, Mic <micta...@gmail.com> wrote:
> Hi Roland,
> I tried it out unsuccessful with the following code:
> import akka.dispatch.{Future, ExecutionContext}
> import akka.util.duration._
> import java.util.concurrent.Executors
> object Communication {
> def main(args: Array[String]) {
> implicit val ec = ExecutionContext.fromExecutorService(
> Executors.newCachedThreadPool());
> // send tasks to the dispather
> val 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?
Usually when one reports a problem, they include what the actual problem
was.
Follow the Scala compiler:
<console>:19: error: value println is not a member of
akka.dispatch.Future[String]
} map(_.mkString("\n")) println andThen { case _ => ec.shutdown }
>> Hi Viktor,
>> I am sorry. I meant to get something like this:
>> 0 x 0 = 0
>> 1 x 1 = 1
>> 2 x 2 = 4
>> 3 x 3 = 9
>> 4 x 4 = 16
>> 5 x 5 = 25
>> 6 x 6 = 36
>> 7 x 7 = 49
>> 8 x 8 = 64
>> 9 x 9 = 81
>> Cheers,
>> Mic
>> On Monday, May 7, 2012 9:53:47 AM UTC+10, √ wrote:
>>> Hi Mic,
>>> On Mon, May 7, 2012 at 1:49 AM, Mic <micta...@gmail.com> wrote:
>>>> Hi Viktor,
>>>> Thank you. How to improve the output from the following code:
>>> How do I improve something without being given a metric?
>>>>>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act****or-2.0.1.jar:.
>>>>>>> HelloWorldFuture.scala
>>>>>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>>>>>> parameter executor: akka.dispatch.ExecutionContext
>>>>>>> val future = Future {
>>>>>>> ^
>>>>>>> one error found
>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@*
>>>>>> *googlegr**oups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>>>> For more options, visit this group at http://groups.google.com/** >>>>>> group**/akka-user?hl=en<http://groups.google.com/group/akka-user?hl=en>
>>>>>> .
>>>>> --
>>>>> Viktor Klang
>>>>> Akka Tech Lead
>>>>> Typesafe <http://www.typesafe.com/> - The software stack for
>>>>> applications that scale
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>> For more options, visit this group at http://groups.google.com/** >>>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>.
>>> --
>>> Viktor Klang
>>> Akka Tech Lead
>>> Typesafe <http://www.typesafe.com/> - The software stack for
>>> applications that scale
>>> Twitter: @viktorklang
>> --
>> 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/-/nxeatUyc_G0J.
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/akka-user?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/akka-user?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To post to this group, send email to akka-user@googlegroups.com.
> To unsubscribe from this group, send email to
> akka-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akka-user?hl=en.
-- Viktor Klang
Akka Tech Lead
Typesafe <http://www.typesafe.com/> - The software stack for applications
that scale
> On Mon, May 7, 2012 at 3:33 PM, Mic <micta...@gmail.com> wrote:
>> Hi Roland,
>> I tried it out unsuccessful with the following code:
>> import akka.dispatch.{Future, ExecutionContext}
>> import akka.util.duration._
>> import java.util.concurrent.Executors
>> object Communication {
>> def main(args: Array[String]) {
>> implicit val ec = ExecutionContext.fromExecutorService(
>> Executors.newCachedThreadPool());
>> // send tasks to the dispather
>> val 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?
> Usually when one reports a problem, they include what the actual problem
> was.
> Follow the Scala compiler:
> <console>:19: error: value println is not a member of
> akka.dispatch.Future[String]
> } map(_.mkString("\n")) println andThen { case _ => ec.shutdown
> }
> Cheers,
> √
>> Thank you in advance.
>> Mic
>> On Mon, May 7, 2012 at 4:46 PM, Roland Kuhn <goo...@rkuhn.info> wrote:
>>> Hi Viktor,
>>> I am sorry. I meant to get something like this:
>>> 0 x 0 = 0
>>> 1 x 1 = 1
>>> 2 x 2 = 4
>>> 3 x 3 = 9
>>> 4 x 4 = 16
>>> 5 x 5 = 25
>>> 6 x 6 = 36
>>> 7 x 7 = 49
>>> 8 x 8 = 64
>>> 9 x 9 = 81
>>> Cheers,
>>> Mic
>>> On Monday, May 7, 2012 9:53:47 AM UTC+10, √ wrote:
>>>> Hi Mic,
>>>> On Mon, May 7, 2012 at 1:49 AM, Mic <micta...@gmail.com> wrote:
>>>>> Hi Viktor,
>>>>> Thank you. How to improve the output from the following code:
>>>> How do I improve something without being given a metric?
>>>>>>>> $ fsc -cp ../jars/akka/lib/akka/akka-**act****or-2.0.1.jar:.
>>>>>>>> HelloWorldFuture.scala
>>>>>>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>>>>>>> parameter executor: akka.dispatch.ExecutionContext
>>>>>>>> val future = Future {
>>>>>>>> ^
>>>>>>>> one error found
>>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@
>>>>>>> **googlegr**oups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>>>>> For more options, visit this group at http://groups.google.com/** >>>>>>> group**/akka-user?hl=en<http://groups.google.com/group/akka-user?hl=en>
>>>>>>> .
>>>>>> --
>>>>>> Viktor Klang
>>>>>> Akka Tech Lead
>>>>>> Typesafe <http://www.typesafe.com/> - The software stack for
>>>>>> applications that scale
>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>> To unsubscribe from this group, send email to akka-user+unsubscribe@**
>>>>> googlegroups.com <akka-user%2Bunsubscribe@googlegroups.com>.
>>>>> For more options, visit this group at http://groups.google.com/** >>>>> group/akka-user?hl=en <http://groups.google.com/group/akka-user?hl=en>
>>>>> .
>>>> --
>>>> Viktor Klang
>>>> Akka Tech Lead
>>>> Typesafe <http://www.typesafe.com/> - The software stack for
>>>> applications that scale
>>>> Twitter: @viktorklang
>>> --
>>> 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/-/nxeatUyc_G0J.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> akka-user+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/akka-user?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Akka User List" group.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> akka-user+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/akka-user?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To post to this group, send email to akka-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> akka-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/akka-user?hl=en.
On Tue, May 8, 2012 at 4:14 AM, Mic <micta...@gmail.com> wrote:
> Hi Viktor,
> I am sorry, but Scala-IDE only print out:
> Error: Could not find or load main class Communication
> In the future I will provide scalac direct output.
> Output:
> 0 x 0 = 0
> 1 x 1 = 1
> 2 x 2 = 4
> 3 x 3 = 9
> 4 x 4 = 16
> 5 x 5 = 25
> 6 x 6 = 36
> 7 x 7 = 49
> 8 x 8 = 64
> 9 x 9 = 81
> Thank you in advance.
> Mic
> On Mon, May 7, 2012 at 11:40 PM, √iktor Ҡlang <viktor.kl...@gmail.com>
> wrote:
>> On Mon, May 7, 2012 at 3:33 PM, Mic <micta...@gmail.com> wrote:
>>> Hi Roland,
>>> I tried it out unsuccessful with the following code:
>>> import akka.dispatch.{Future, ExecutionContext}
>>> import akka.util.duration._
>>> import java.util.concurrent.Executors
>>> object Communication {
>>> def main(args: Array[String]) {
>>> implicit val ec = ExecutionContext.fromExecutorService(
>>> Executors.newCachedThreadPool());
>>> // send tasks to the dispather
>>> val 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?
>> Usually when one reports a problem, they include what the actual problem
>> was.
>> Follow the Scala compiler:
>> <console>:19: error: value println is not a member of
>> akka.dispatch.Future[String]
>> } map(_.mkString("\n")) println andThen { case _ => ec.shutdown
>> }
>> Cheers,
>> √
>>> Thank you in advance.
>>> Mic
>>> On Mon, May 7, 2012 at 4:46 PM, Roland Kuhn <goo...@rkuhn.info> wrote:
>>>> Hi Viktor,
>>>> I am sorry. I meant to get something like this:
>>>> 0 x 0 = 0
>>>> 1 x 1 = 1
>>>> 2 x 2 = 4
>>>> 3 x 3 = 9
>>>> 4 x 4 = 16
>>>> 5 x 5 = 25
>>>> 6 x 6 = 36
>>>> 7 x 7 = 49
>>>> 8 x 8 = 64
>>>> 9 x 9 = 81
>>>> Cheers,
>>>> Mic
>>>> On Monday, May 7, 2012 9:53:47 AM UTC+10, √ wrote:
>>>>> Hi Mic,
>>>>> On Mon, May 7, 2012 at 1:49 AM, Mic <micta...@gmail.com> wrote:
>>>>>> Hi Viktor,
>>>>>> Thank you. How to improve the output from the following code:
>>>>> How do I improve something without being given a metric?
>>>>>>>>> $ fsc -cp ../jars/akka/lib/akka/akka-actor-2.0.1.jar:.
>>>>>>>>> HelloWorldFuture.scala
>>>>>>>>> HelloWorldFuture.scala:8: error: could not find implicit value for
>>>>>>>>> parameter executor: akka.dispatch.ExecutionContext
>>>>>>>>> val future = Future {
>>>>>>>>> ^
>>>>>>>>> one error found
>>>>>>>>> What did I do wrong?
>>>>>>>>> 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/-/f-2AIM4QU_EJ.
>>>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>>>> To unsubscribe from this group, send email to
>>>>>>>> akka-user+unsubscribe@googlegroups.com.
>>>>>>>> For more options, visit this group at
>>>>>>>> http://groups.google.com/group/akka-user?hl=en.
>>>>>>> --
>>>>>>> Viktor Klang
>>>>>>> Akka Tech Lead
>>>>>>> Typesafe - The software stack for applications that scale
>>>>>>> Twitter: @viktorklang
>>>>>> --
>>>>>> 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/-/kxwpgm6EPNgJ.
>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>> To unsubscribe from this group, send email to
>>>>>> akka-user+unsubscribe@googlegroups.com.
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/akka-user?hl=en.
>>>>> --
>>>>> Viktor Klang
>>>>> Akka Tech Lead
>>>>> Typesafe - The software stack for applications that scale
>>>>> Twitter: @viktorklang
>>>> --
>>>> 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/-/nxeatUyc_G0J.
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> akka-user+unsubscribe@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/akka-user?hl=en.
>>>> Roland Kuhn
>>>> Typesafe – The software stack for applications that scale.
>>>> twitter: @rolandkuhn
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Akka User List" group.
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> akka-user+unsubscribe@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/akka-user?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Akka User List" group.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> akka-user+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/akka-user?hl=en.
>> --
>> Viktor Klang
>> Akka Tech Lead
>> Typesafe - The software stack for applications that scale