Skip to content

Commit

Permalink
5.5. Add sample
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru committed Jun 9, 2016
1 parent 9dfbaee commit 45e94ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion sections/.#5-actors.md

This file was deleted.

17 changes: 9 additions & 8 deletions sections/5-actors.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ building state machines, called
[Akka FSM](http://doc.akka.io/docs/akka/current/scala/fsm.html).

But it's inadequate, limiting and its usage leads to bad
practices. Current projects should try replacing it and new
projects should steer clear from it. Prefer to model state machines with
practices. Current projects should try replacing it and new projects
should steer clear from it. Prefer to model state machines with
`context.become` instead.

The three big reasons for why you want to avoid Akka FSM:
Expand Down Expand Up @@ -403,12 +403,13 @@ firstGoto(Ramping).thenGoto(Dispatched)
```

This is a made up API. Akka FSM doesn't support this. And at this
point you'll need to fork Akka FSM in order to get it. It's certainly
doable. I know I did it. But if you end up forking Akka's FSM for your
project, you've clearly made a mistake in picking Akka FSM in the
first place. And of course, most people won't ever think of forking
Akka FSM, so they'll end up with hard to test and unreasonable hacks,
like pushing extra internal messages on this actor.
point you'll need to fork Akka FSM in order to get it. It's
[certainly doable](https://gist.github.com/alexandru/b663d50642a25a3644f4277751c5adfb).
But if you end up forking Akka's FSM for your project, you've clearly
made a mistake in picking Akka FSM in the first place. And of course,
most people won't ever think of forking Akka FSM, so they'll end up
with hard to test and unreasonable hacks, like pushing extra internal
messages on this actor.

The other reason for why Akka FSM is not adequate is because it forces
you to model your state machine as a thing that mutates its
Expand Down

0 comments on commit 45e94ab

Please sign in to comment.