* Changed signatures and constructor of MessageDispatcherConfigurator
* Changed Dispatchers.lookup, keep configurators instead of dispatchers
* Removed most of the Dispatchers.newX methods, newDispatcher is still there because of priority mailbox
* How should we make it easy to configure priority mailbox?
* Changed tons tests
* Documentation and ScalaDoc is not updated yet
* Some tests in ActorModelSpec are temporary ignored due to failure
* Aligned the Java and Scala documentation for Actors
* Implemented hotswap samples in Java, and documented in same way as Scala docs
* Improved Actors (Scala) docs
* Fixed wrong preRestart and postRestart in UntypedActor
* Changed name of Dispatchers.fromConfig to newFromConfig and made it Java friendly
* Added ActorRef.ask with Timeout parameter in addition to the timeoutMillis
- create RemoteActorRef in actorFor
- simplify send/receive because Futures/Exceptions do not go over the
wire anymore
- add RemoteCommunicationSpec which uses two ActorSystems communicating
in the same JVM via TCP socket
The reason for the previously failing test case was that Jenkins has
only two (logical) cores and the test config sets the
core-pool-size-factor to 2, meaning four threads. This is not enough to
have four Futures waiting (as per the test) and one actor which actually
does the work (the guardian in this case). Hence, make it so that
core-pool-size-min gives the absolute minimum and set the default of
that to eight.
While doing so I cleaned up the MessageDispatcherConfigurator to not use
HOF since now configuration items are not optional anymore, yielding a
flow which is much more readily understandable.
- run closeScheduler upon ActorSystem termination (directly)
- this will execute all outstanding tasks (dispatcher shutdowns have
been queued already, because the last actor has already exited)
- further use of the scheduler (e.g. from tasks just being run) results
in IllegalStateException
- catch such exceptions in DefaultPromise&MessageDispatcher in case of
self-rescheduling tasks and execute final action immediately
- also silently stop recurring tasks
- it was telling all children to stop(), then waited for the
ChildTerminated messages and finally terminated itself
- this worked fine, except when the stop came from the supervisor, i.e.
the recipient was suspended and did not process the ChildTerminated
- so, as the mirror of Supervise() that it is, I changed
ChildTerminated() to be a system message and instead of stopping
processing normal messages by checking the stopping flag, just suspend
the actor while awaiting the ChildTerminated's to flow in.
* Dispatchers need Scheduler to be able to shutdown themselves. Stop Scheduler after dispatchers.
* Changed CallingThreadDispatcher global object to Extension, since it holds map of references to mailboxes. Will be GC:ed when system is GC:ed.
* Made testActor lazy, since it is not used in all tests, and it creates CallingThreadDispatcher.
* Activated some java tests that were not running
* Many tests were not stopping created ActorSystems. VERY IMPORTANT TO STOP ActorSystem in tests. Use AkkaSpec as much as possible.
* Used profiler to verify (and find) dangling ActorSystemImpl and threads from dispatchers.
* FutureSpec creates ForkJoinPool threads that are not cleared, but number of threads don't grow so it's not a problem.
* Fixed obvious
* Created tickets for several, #1408, #1409, #1410, #1412, #1415, 1416, #1418
* Moved LoggingReceive from akka.actor to akka.event
* Touched several of the FIXME to make them visible in code review
- ensure that no “complex” things are attached to a LogEvent (think
serialization)
- ensure no escaping the “this” reference via LoggingBus during
constructors (e.g. ActorSystem)
- change it so that
+ Actor/ActorRef are represented by their address
+ Class[_] by simpleName
+ String by itself
- this means that people need to think a little more while deciding how
“this” should look like in logging (which I think is a good thing)
* All default values removed from code and loaded from akka-actor-reference.conf, located in src/main/resources (included in jar)
* Default test configuration included in AkkaSpec instead of using akka.test.conf, avoids problems when running test (in IDE) and forgetting to use -Dakka.mode=test.
* System.properties used first, if availble
* Next step will be to split akka-actor-reference.conf in separate -reference for each module
(cascading into all dispatchers, mailboxes, other stuff; had to move
deadLetter stuff to ActorSystem again and split its initialization due
to cyclic dependency)
- the same information is transmitted as sender, hence enabling
ChildTerminated to become a singleton
- make lastSender accessible in TestKit (needed now for DeathWatchSpec)
- fix nasty infinite loop when logging at the wrong moment during
shutdown
(since I know now what’s causing these Jenkins failures ;-) )
- include recipient in DeadLetter
- include recipient in calls to enqueue/systemEnqueue
- move DeadLetterMailbox to ActorSystem (saves some space, too)
- hook up DeadLetterMailbox so it sends DeadLetters to app.deadLetters,
which publishes them on the eventStream
- subscribe TestEventListener to DeadLetter and turn it into Warning
The generated warnings about ChildTerminated are very much correct, they
remind us that we still need to fix supervisor.stop() to await all
children’s death before actually committing suicide.
- enqueuing system messages to DeadLetterMailbox was broken in
principle, but not in practice for the current default deadLetter
implementation
- add assert that system messages are not enqueued multiple times
- *BusSpec was using incorrect compareSubscribers based on
identityHashCode, so moved the proper solution out of
BalancingDispatcher and into akka.util.Helpers and reuse that in all
places
BalancingDispatcherModelSpec is currently broken, leaves count==1 in
wavesOfActors test, committed anyway in order to check out where it
broke before this merge