The Artima Developer Community
Sponsored Link

Akka Concurrency Forum
Chapter 8 Decider is not a built-in type in Akka

2 replies on 1 page. Most recent reply: Nov 14, 2012 5:52 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

Chapter 8 Decider is not a built-in type in Akka Posted: Nov 13, 2012 8:49 AM
Reply to this message Reply
Advertisement
I am using Akka 2.10.0-RC2.

The following is a minor point.
When I first look at the listing at bottom of p195 (in chapter 8), I got the impression that Decider is a built-in type in Akka. In fact it is not.

trait SupervisionStrategyFactory {
def makeStrategy(maxNrRetries: Int,withinTimeRange: Duration) (decider: Decider): SupervisorStrategy
}

I added the following obvious alias to make the above compile.
type Decider = PartialFunction[Throwable, Directive]


Shing


Derek Wyatt

Posts: 69
Nickname: dwyatt
Registered: Oct, 2012

Re: Chapter 8 Decider is not a built-in type in Akka Posted: Nov 13, 2012 3:59 PM
Reply to this message Reply
Don't do that :)

This is defined in the SupervisorStrategy. You can see a number of pages previous to the one that you're reading that we did an import of akka.actor.SupervisorStrategy._ and that import will give you what you need. I don't repeat the imports for every example, and just assume that the chapter runs forward, each example building on the next.

That might not be totally clear though...

But, please remove the type alias you added and import the SupervisorStrategy._

Cheers,
Derek

Shing Hing Man

Posts: 9
Nickname: 84423
Registered: Oct, 2012

Re: Chapter 8 Decider is not a built-in type in Akka Posted: Nov 14, 2012 5:52 AM
Reply to this message Reply
Silly me ! You are right.

Thanks!

Shing

Flat View: This topic has 2 replies on 1 page
Topic: I'll be off the air for a few days Previous Topic   Next Topic Topic: where to download the sample code ?

Sponsored Links



Google
  Web Artima.com   

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