Commit graph

89 commits

Author SHA1 Message Date
Björn Antonsson
e5bcf8bfc9 +act #3770 Added Java 8 friendly APIs for Actor and FSM 2014-01-20 12:00:13 +01:00
Patrik Nordwall
4ab877e765 !act #3786 Remove deprecated DefaultScheduler
* Replaced by LightArrayRevolverScheduler
2013-12-12 13:17:43 +01:00
Roland Kuhn
e14f22f2e3 rework LARS, see #3428
- 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.
2013-06-19 15:28:23 +02:00
Viktor Klang
1f694a3612 #3405 - fix race between consumer and producer for MPSC 2013-05-28 16:54:58 +02:00
Viktor Klang
dddc3a6630 #3203 - deprecating HashedWheelTimer 2013-04-07 20:07:26 +02:00
Viktor Klang
c48a2c4aac Renaming peek() to peekNode and making it protected, then creating a new peek that returns T 2013-04-03 20:55:41 +02:00
Viktor Klang
68dfada8bc Moving in isEmpty and count into AbstractNodeQueue 2013-04-03 20:05:20 +02:00
Viktor Klang
3ab3de1eb6 Making SerializedSuspendableExecutionContext use AbstractNodeQueue instead of ConcurrentLinkedQueue 2013-03-29 01:50:00 +01:00
Viktor Klang
fb2decbcda Adding high-performance MPSC queue based mailbox to Akka 2013-03-14 14:37:57 +01:00
Patrik Nordwall
2a45d99ab3 Change more copyright to 2009-2013, see #2879
* Also added some missing headers
2013-02-20 21:26:52 +01:00
Roland Kuhn
7066b37077 Merge pull request #1027 from akka/wip-2904-timer-∂π
first cut of new AkkaTimer, see #2904
2013-01-23 11:06:41 -08:00
Roland
8dea20a1f1 LightArrayRevolverScheduler, see #2904
- 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
2013-01-23 19:57:44 +01:00
Viktor Klang
4474c34e7c #2782 - Removing ConcurrentIdentityHashMap and shake this all about 2013-01-22 15:11:49 +01:00
Viktor Klang (√)
6b638db65e Merge pull request #1006 from akka/wip-2879-copyright2013-√
#2879 - updating copyright info
2013-01-14 04:59:29 -08:00
Matthew Neeley
382dc3b1e4 Fix HashedWheelTimer when timeout is multiple of wheel period #2898 2013-01-10 16:14:12 -08:00
Viktor Klang
adfeb2c1f0 #2879 - updating copyright info 2013-01-09 11:38:00 +01:00
Viktor Klang
3ff997a3ca #2742 - making reuseAddress default false on windows with option to turn it on for everybody or off for everybody 2012-12-18 13:34:53 +01:00
Roland
17e6b13b65 fix lookup of top-level’s children, see #2675
- the problem existed only when creating children within the constructor
  of a top-level actor
- add a test which verifies this
2012-11-26 15:56:17 +01:00
Roland Kuhn
44bf8a5d82 Merge pull request #869 from akka/wip-2686-HWT-overflow-∂π
make HashedWheelTimer tolerate wrap-arounds, see #2686
2012-11-15 08:41:04 -08:00
Roland
69505855fd make HashedWheelTimer tolerate wrap-arounds, see #2686 2012-11-14 17:08:01 +01:00
Viktor Klang
b00c47854b Switching over to immutable.Iterable where possible 2012-11-14 16:24:25 +01:00
Roland
0f04239f67 move Duration classes according to scala 2.10 nightly and remove casts to FiniteDuration, see #2504 2012-10-11 15:18:10 -07:00
Roland
ce49ffe3c6 remove all but one occurrence of single-arg tell() 2012-09-19 23:55:53 +02:00
Roland
947cea3a8c more conversion to FiniteDuration, plus fix the build, see #2521
- 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
2012-09-18 18:17:44 +02:00
Roland
35b7a9e338 second round of FiniteDuration business, including cluster fixes
- make Scheduler only accept FiniteDuration, which has quite some
  knock-on effects
2012-09-18 09:58:30 +02:00
Viktor Klang
67d917f98e Replacing if-statement with epic usage of Math.max 2012-08-06 17:41:17 +02:00
Viktor Klang
c491ccfbf8 Major cleanup in HWT, Making the Timeout a static class to be able to use Unsafe instead of AtomicInteger. Sprinkling finals and changing code formatting.
(RK: cherry-picked from Viktor’s branch and cleaned up two “unused”
warnings)
2012-08-06 15:41:51 +02:00
Roland
a5068a50a3 simplify HWT logic and make better use of inaccuracy, see #2354
- use actual time after wake-up to determine runnable tasks, not
  precalculated and aimed-for deadline
2012-08-06 15:38:51 +02:00
Roland
dca8d15c68 Merge branch 'wip-2212-recursive-resume-∂π' into wip-scala210M5-√
only merged so that it compiles, will clean up warnings in the following
commits
2012-07-23 14:17:45 +02:00
Roland
36ac4d89de split up ActorCell functionality into multiple source files
- 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
2012-07-08 17:41:22 +02:00
Viktor Klang
ac5b5de90a Merging in master, huge work trying to get things to compile, tests not green at this stage 2012-07-06 17:04:04 +02:00
Roland
cde7b29a33 Merge branch 'wip-1952-testkit-java-∂π' 2012-07-04 17:38:20 +02:00
Viktor Klang
52d33113d9 Partial work + broken commit 2012-07-04 15:25:30 +02:00
Viktor Klang
54a3a44bf8 #2292 - Removing akka.util.Duration etc and replace it with scala.concurrent.util.Duration 2012-06-29 13:33:20 +02:00
Viktor Klang
def4dc6513 Removing the dead code that is SystemPropertyUtil 2012-06-26 18:25:42 +02:00
Viktor Klang
702b5d9c19 Switching to the embedded jsr166y in scala.concurrent and dropping akka.jsr166y 2012-06-26 18:19:55 +02:00
Roland
be74eb835b stashin commit so Iulian can play with it 2012-06-25 19:30:13 +02:00
Roland
b60210362e make system.actorOf() non-blocking (and working), see #2031
- 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.
2012-06-13 17:57:56 +02:00
Roland
df89184b30 make system.actorOf non-blocking (*), see #2031
(*) 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
2012-06-08 00:10:05 +02:00
Viktor Klang
a5127b12dd Merge branch 'master' into wip-2134-deathwatch2.0-√ 2012-06-04 13:58:09 +02:00
Viktor Klang
2e788c9704 Adding some sanity and some CAS-magic 2012-06-04 11:46:59 +02:00
Brian Scully
6a415f0e9b * Add Circuit Breaker to akka.pattern for general use. Circuit breaker implementation as described by Michael T. Nygard in Release It!. Fixes #1734
* 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
2012-06-01 08:24:47 -04:00
Viktor Klang
8bdb870246 Implementing death watch for PromiseActorRef 2012-05-30 13:24:38 +02:00
Viktor Klang
260e281449 #2102 - porting over the fix for Netty/356 2012-05-29 01:43:39 +02:00
Viktor Klang
5cbcb612b2 Moving the HWT stuff from org.jboss.netty.akka.util to akka.util.internal 2012-05-20 15:56:52 +02:00
Viktor Klang
db3ce87917 Removing the Atomic*Updaters from MessageDispatcher, switching to Unsafe all the way baby 2012-05-11 15:00:37 +02:00
Viktor Klang
57c5dd00e0 Removing akka.actor.Actors since they were deprecated in 2.0.2 2012-05-07 20:37:56 +02:00
Viktor Klang
0a5d5f7060 Optimizing AbstractPromise to avoid initial CAS 2012-04-26 10:55:51 +02:00
Viktor Klang
fbb3356fb0 #2023 - Switching from ARFU to Unsafe for the DefaultPromise 2012-04-26 02:12:59 +02:00
Viktor Klang
3468a694f8 Manual patch of Doug Leas fix to ForkJoinPool 2012-04-02 18:06:55 +02:00