The Artima Developer Community
Sponsored Link

Akka Concurrency Forum
Which version of Scala, Akka are used in the book ?

2 replies on 1 page. Most recent reply: Oct 31, 2012 2:39 AM by Shing Hing Man

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Shing Hing Man

Posts: 9
Nickname: 84423
Registered: Oct, 2012

Which version of Scala, Akka are used in the book ? Posted: Oct 30, 2012 8:54 AM
Reply to this message Reply
Advertisement
I am using Scala 2.9.2 and Akka 2.0.2.

On Page 111, in the object Avionics,
val control = Await.result(
(plane ? Plane.GiveMeControl).mapTo[ActorRef],5.seconds)

does not compile with error :
value ? is not a member of akka.actor.ActorRef


Instead of the above, the following compiles :
val future = Patterns.ask(plane, Plane.GiveMeControl, timeout);
val control = Await.result(future, timeout.duration).asInstanceOf[ActorRef]


May I know which version of Scala and Akka are used in the book.

Thanks in advance for any assistance !

Shing


Derek Wyatt

Posts: 69
Nickname: dwyatt
Registered: Oct, 2012

Re: Which version of Scala, Akka are used in the book ? Posted: Oct 31, 2012 1:54 AM
Reply to this message Reply
At the time of writing, it was Scala 2.10.0-M7 and Akka 2.1-M2. When everything finally solidifies, I'll be switching it to 2.10.0 and 2.1 proper. You should be able to use 2.10.0-RC1 and 2.1-RC1 and have no issues.

But, I think you're just missing the pattern import.

import akka.pattern.ask

and you should get the '?' method added on to the ActorRef.

Cheers,
Derek

Shing Hing Man

Posts: 9
Nickname: 84423
Registered: Oct, 2012

Re: Which version of Scala, Akka are used in the book ? Posted: Oct 31, 2012 2:39 AM
Reply to this message Reply
I have tried your suggestion and it works.

Thanks!

Shing

Flat View: This topic has 2 replies on 1 page
Topic: "Actar" instead of Actor Previous Topic   Next Topic Topic: Section 6.5 - gracefulStop

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use