- tasks are still enqueued without reading the clock
- in order to be resilient against timer thread over-sleeping the tasks
are passed to the timer thread using an AbstractNodeQueue and the
wheel itself is now private to the timer thread
- reuse queue Nodes along the way to minimize allocation costs
The problem with the old implementation was that the timer thread could
sleep too long, then wake up and run multiple buckets in quick
succession. Tasks enqueued just before that event could then get
executed basically immediately, i.e. before their allotted time.
- based on a wheel (AtomicReferenceArray) from which atomic
single-linked lists dangle
- no locks
- deterministic tests due to overridable time source
- also bring docs up to date
- also remove resetReceiveTimeout and change receiveTimeout() to return
a Duration (which may be Undefined)
- also move akka.actor.{cell -> dungeon}, because that is
+ an adequate name
+ and does not coincide with the lowercase version of a class name
- created package akka.actor.cell to hold the different traits from
which the ActorCell cake is made
- split up by topic, but leave the message processing itself within
ActorCell
- move ChildrenContainer into the akka.actor.cell package
- move AbstractActorCell also
- make members of the behavior traits private/protected to tighten their
scope as much as possible => make it easier to see what’s going on
- introducing RepointableActorRef, which starts out with an
UnstartedActorCell which can cheaply be created; the Supervise()
message will trigger child.activate() in the supervisor, which means
that the actual creation (now with normal ActorCell) happens exactly
in the right place and with the right semantics. Messages which were
enqueued to the dummy cell are transferred atomically into the
ActorCell (using normal .tell()), so message sends keep working
exactly as they used to
- this enables getting rid of the brittle synchronization around
RoutedActorRef by replacing that one with a RepointableActorRef
subclass which creates RoutedActorCells upon activate(), with the nice
benefit that there is no hurry then to get it right because the new
cell is constructed “on the side”
misc fixes:
- InvalidMessageException is now actually enforced when trying to send
“null”
- Mailboxes may be created without having an ActorCell, which can come
in handy later, because the cell is only needed when this mailbox is
going to be scheduled on some executor
- remove occurrences of Props(), which is equivalent to Props[Nothing],
which is equivalent to «bug»
- add test case which verifies that context.actorOf is still synchronous
- plus all the stuff I have forgotten.
(*) that actually depends on whether provider.actorOf blocks, which
currently MAY happen when actor creation triggers a remote connection
- properly CAS childrenRefs within ActorCell, making it safe to update
from the outside
- add reserve/unreserve to ChildrenContainer and move uniqueness check
there
- when creating, first reserve, then add the actor; unreserve if
provider.actorOf did fail
* Uses finite state machine for three states: Closed, Open, Half-Open
* Closed state allows calls through, and on sequential failures exceeding the max# set - transitions to Open state. Intervening successes cause the failure count to reset to 0
* Open state throws a CircuitOpenException on every call until the reset timeout is reached which causes a transition to Half-Open state
* Half-Open state will allow the next single call through, if it succeeds - transition to Closed state, if it fails - transition back to Open state, starting the reset timer again
* Allow configuration for the call and reset timeouts, as well as the maximum number of sequential failures before opening
* Supports async or synchronous call protection
* Callbacks are supported for state entry into Closed, Open, Half-Open. These are run in the supplied execution context
* Both thrown exceptions and calls exceeding max call time are considered failures
* Uses akka scheduler for timer events
* Integrated into File-Based durable mailbox
* Sample documented for other durable mailboxes