Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 #8

Open
fntz opened this issue Sep 14, 2016 · 1 comment
Open

4 #8

fntz opened this issue Sep 14, 2016 · 1 comment

Comments

@fntz
Copy link

fntz commented Sep 14, 2016

  1. default dispatcher like a kek, use must use more threads, it's free
  2. Boot.scala

val api = system.actorOf(RestInterface.props(placesActor: ActorRef, spApi: ActorRef), "httpInterface")
placesActor: ActorRef, spApi: ActorRef

why i should it see?

  1. Boot.scala
...
case _ => system.log.error("Bot hasn't been started")

is it possible start all without bot? free hashtags: #akka #fault #tolerance

  1. package name to very informative
  2. read config via ficus
  3. move all models/* in package object models plz.
  4. use require in AirportId, idea is cool 👍
if (id.head.isUpper && id.length > 3) {
    throw new Exception(s"$id is not an airport id")
  }
  1. instead of equals use scalaz.Equals (===) type class
  2. class TripRoute(val firstAirport: AirportId, val firstDate: LocalDate) => case class
override val supervisorStrategy =
    OneForOneStrategy() {
      case e: Exception =>
        e.printStackTrace()
        Restart
    }

what you know about logs?
Why restart? why not stop or resume?

  1. routes.synchronized { routes += current } please no, agents

or some like

var routes = new ListBuffer[TripRoute]() with SynchronizedBuffer[TripRoute] 
  1. for my opinion TripsCalculator is very hard for read and support move some part of this actor in different objects (good for testing). and use custom execution context for this some like this
class TripsCalculator extends ... {
   def receive = {
     case _ =>
       TripsCalculator.myCalc(...)
   }
}

object TripsCalculator {
   def myCalc(...)(implicit ec: ExecutionContext) = {}
}

  1. enjoy
@fntz
Copy link
Author

fntz commented Sep 14, 2016

I want to remind branch name is ze REFACTORING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant