panic
signals "the programmer has made a fundamental mistake and execution cannot continue safely", whereas os.Exit
signals "the programmer has decided that the process should terminate here" — different meanings. Also, important difference in behavior: panic
will unwind the callstack, which means it will call any pending defer
statements; os.Exit
will just do a hard kill, so it won't.
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample.akka.testkit | |
import akka.actor.ActorSystem | |
import akka.actor.Actor | |
import akka.testkit.{TestKit, TestActorRef} | |
import org.scalatest.matchers.MustMatchers | |
import org.scalatest.WordSpec | |
class ImplicitSenderTest extends TestKit(ActorSystem("testSystem")) | |
// Using the ImplicitSender trait will automatically set `testActor` as the sender |