Commit graph

61 commits

Author SHA1 Message Date
Patrik Nordwall
5033647176 Fixed things from review. See #1310 2012-02-01 17:38:12 +01:00
Patrik Nordwall
c447f46224 Some polish on the error handling. See #1310 2012-02-01 14:40:12 +01:00
Viktor Klang
2e834b08e2 Removing dead imports from testkit 2012-01-25 15:59:37 +01:00
Roland
d5c23bcb76 add ExtendedActorSystem to shield ActorSystemImpl
- add provider, guardian, systemGuardian and deathWatch to it
- make ActorSystemImpl extend ExtendedActorSystem
- use ExtendedActorSystem for creating extensions, thereby limiting the
  access extensions get to just those four published methods.
2012-01-24 11:33:40 +01:00
Viktor Klang
149fbea5a7 Updating Copyright as per #1660 2012-01-19 18:21:06 +01:00
Roland
6fddb87fca fix one spurious buglet in CallingThreadDispatcher, see #1375 2012-01-10 13:33:57 +01:00
Viktor Klang
8db3f6aa0a Removing mailboxIsEmpty and mailboxSize from MessageDispatcher 2011-12-27 14:43:37 +01:00
Patrik Nordwall
df260f8939 Improvements based on feedback. See #1458 2011-12-21 19:02:06 +01:00
Patrik Nordwall
f772b0183e Initial commit of dispatcher key refactoring, for review. See #1458
* 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
2011-12-21 13:27:50 +01:00
Roland
4c1d722398 fix bug in ActorRef.stop() implementation
- 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.
2011-12-03 18:53:04 +01:00
Patrik Nordwall
79866e5729 Made DefaultScheduler Closeable 2011-12-02 10:32:17 +01:00
Patrik Nordwall
b488d70f54 Fixed several memory and thread leaks. See #1404
* 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.
2011-12-02 09:48:21 +01:00
Patrik Nordwall
80ac1737cd First walk throught of FIXME. See #1378
* 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
2011-11-30 10:48:26 +01:00
Patrik Nordwall
e5f8a41cb8 Remove default time unit in config. All durations explicit. See #1363
* Also changed in dispatcher to use explicit Duration instead of Int/Long
2011-11-21 15:18:52 +01:00
Roland
6a8e516b6c change source tag in log events from AnyRef to String
- 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)
2011-11-18 12:24:04 +01:00
Viktor Klang
80d766b07b Adding DispatcherPrerequisites to hold the common dependencies that a dispatcher needs to be created 2011-11-17 16:09:18 +01:00
Roland
62032cb1ff merge system-cleanup into master 2011-11-17 14:38:49 +01:00
Viktor Klang
13bfee782f Removing Un(der)used locking utils (locking is evil) and removing the last locks from the MessageDispatcher 2011-11-16 15:54:14 +01:00
Roland
f2bf27b4de remove app argument from Dispatchers
(cascading into all dispatchers, mailboxes, other stuff; had to move
deadLetter stuff to ActorSystem again and split its initialization due
to cyclic dependency)
2011-11-14 16:03:26 +01:00
Viktor Klang
e40b7cd8d6 Fixing bug where a dispatcher would shut down the executor service before all tasks were executed, also taking the opportunity to decrease the size per mailbox by atleast 4 bytes 2011-11-14 14:09:23 +01:00
Roland
02a5cd081c remove ActorRef from Failed/ChildTerminated and make some warnings nicer
- 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
2011-11-13 00:19:56 +01:00
Roland
1ba168774f improve DeadLetter reporting
(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.
2011-11-12 10:57:28 +01:00
Roland
53353d7031 rename MainBus to EventStream (incl. field in ActorSystem) 2011-11-10 21:01:37 +01:00
Roland
945b1aedf9 rename akka.AkkaApplication to akka.actor.ActorSystem
Renaming it to System did not appeal after seeing that such a thing is
already imported from Predef ...
2011-11-10 21:00:01 +01:00
Roland
a747ef7856 Merge remote branch 'origin/master' into logging
BalancingDispatcherModelSpec is currently broken, leaves count==1 in
wavesOfActors test, committed anyway in order to check out where it
broke before this merge
2011-11-09 14:56:05 +01:00
Viktor Klang
1b730b5c82 Removing Channel(s), tryTell etc, everything compiles but all tests are semibroken 2011-10-31 16:09:51 +01:00
Roland
f46c6dc533 introducing: MainBus feat. LoggingBus
most tests passing, everything compiling, but docs not updated and nasty
thread-leak preventing me from running the whole test-suite (which is
the reason for this commit: I want to chase down that one first).

- the app.mainbus is classified by Class[_] (currently lookup, will
  possibly change to sub-class-aware) and accepts AnyRef messages
- LoggingBus handles akka.event-handlers from config specially:
  + start them as system services, supervised by SystemGuardian
  + keep their subscriptions in sync when logLevel_= is called
  + send them InitializeLogger(bus) message before subscribing them (so
    they can register for extras like Mute/UnMute)
- two-phased start-up: first phase with actor-less stdout logging, then
  subscription of config loggers, then remove stdout logger (logLevels
  configurable separately)
- MainBusReaper watches registered receivers and unsubscribes them upon
  death (started in phase 2)
- logger factory on Logging object, needs app/bus and log source;
  default instance in app.log
2011-10-27 12:36:22 +02:00
Roland
3b62873e2c fix CallingThreadDispatcher’s assumption of mailbox type
- usually it’s a CallingThreadMailbox, but
- it is swapped out for deadLetter upon stop()
- so use Option[CallingThreadMailbox]
2011-10-26 14:20:02 +02:00
Roland
6bcdba40c0 fix InterruptedException handling in CallingThreadDispatcher
instead of just re-setting the flag upon swallowed exception, clear the
flag when fully done and re-throw last swallowed IE.
2011-10-25 15:07:20 +02:00
Roland
fc8ab7dad8 fix CallingThreadDispatcher and re-enable its test 2011-10-21 18:47:44 +02:00
Viktor Klang
0dc3c5ad3d Removing receiver from Envelope and switch to use the Mailbox.actor instead, this should speed up the BalancingDispatcher by some since it doesn't entail any allocations in adopting a message 2011-10-19 13:19:44 +02:00
Roland
183dfb4d7f remove SystemEnvelope
- channel field was always set to NullChannel and not used
- receiver field is better put into the Mailbox, because there it takes
  space only once per actor
- leaves only the bare SystemMessage to be queued
2011-10-18 16:44:35 +02:00
Roland
85b7accfd4 make EventHandler non-global
- add Logging trait for nicer interface
- add EventHandlerLogging class for offering the nice interface from
  app.log
- add eventHandler instance to app and use that for all internal logging
  (this means that some places (dispatchers, remoting) were infiltrated
  by app just to do logging, but I think we'll need app in there soon
  enough for other reasons)
2011-10-13 13:21:59 +02:00
Viktor Klang
1edd52c691 Rewriting so that the termination flag is on the mailbox instead of the ActorCell 2011-09-23 13:14:17 +02:00
Viktor Klang
1662d25944 Rewriting the Balancing dispatcher 2011-09-23 09:33:53 +02:00
Viktor Klang
3d12e47e7d Decoupling system message implementation details from the Mailbox 2011-09-21 16:27:31 +02:00
Roland
7c63f94169 Refactor Mailbox handling
- rename MessageInvocation to Envelope (same for System...)
- rename MessageQueue to Mailbox and include ExecutableMailbox code
- make MailboxType act as factory, so users can provide their own
- properly type mailbox field as Mailbox everywhere
- adapt CallingThreadDispatcher and some tests
- create DeadletterMailbox and use it to replace actor’s mailbox on
  terminate()
2011-09-21 15:16:14 +02:00
Roland
95b42d8c5b fix some of the immediate issues, especially those hindering debugging 2011-09-21 08:25:08 +02:00
Viktor Klang
9007b6e847 Almost there... ActorRefSpec still has a failing test 2011-09-20 18:34:21 +02:00
Peter Vlugter
48deb311fc Rename ActorInstance to ActorCell 2011-09-20 15:45:43 +02:00
Peter Vlugter
b96f3d9260 Initial breakout of ActorInstance. See #1195 2011-09-15 09:54:40 +02:00
Viktor Klang
548ba08cb5 #1145 - Changing private[akka] to protected[akka] in MessageDispatcher so that inheriting classes can access those methods 2011-08-30 15:50:52 +02:00
Viktor Klang
c7d58c600b Adding initial support for Props 2011-08-26 17:25:18 +02:00
Derek Williams
da987138dd Partial fix for ticket #1054: execute callbacks in dispatcher 2011-07-26 22:23:16 -06:00
Peter Vlugter
f406cd98e0 Add abstract method for dispatcher name 2011-07-25 13:53:25 +12:00
Viktor Klang
9d71be7778 Updating copyright section to Typesafe Inc. etc 2011-07-14 16:03:08 +02:00
Viktor Klang
e9f498a1df Unbreaking the build, adding missing file to checkin, I apologize for the inconvenience 2011-07-14 11:26:38 +02:00
Roland
ca592ef1b4 Merge branch 'master' of github.com:jboner/akka
Conflicts:
	akka-actor/src/main/scala/akka/actor/Actor.scala
	akka-actor/src/main/scala/akka/actor/ActorRef.scala
	akka-actor/src/main/scala/akka/actor/TypedActor.scala
	akka-cluster/src/main/scala/akka/cluster/ClusterActorRef.scala
	akka-cluster/src/main/scala/akka/cluster/ReplicatedClusterRef.scala
	akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala
	akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala
	akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java
2011-06-14 00:19:54 +02:00
Roland
7712c20620 unify sender/senderFuture into channel (++)
(squashed merge from the various bits and pieces already part of
release-1.2, everything related to Channel & Future)
2011-06-13 22:36:46 +02:00
Viktor Klang
417fcc779d Adding support for mailboxIsEmpty on MessageDispatcher and removing getMailboxSize and mailboxSize from ActorRef, use actorref.dispatcher.mailboxSize(actorref) and actorref.dispatcher.mailboxIsEmpty(actorref) 2011-06-07 13:23:24 -05:00