Skip to content

Commit 1419810

Browse files
committed
New Agent implementation.
1 parent aba4bcb commit 1419810

18 files changed

+1704
-601
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- No longer `Dereferenceable`
1010
- Now `Observable`
1111
- Added a `#reset` method
12+
* Brand new `Agent` API and implementation. Now functionally equivalent to Clojure.
1213

1314
## Current Release v1.0.0.pre1 (19 Aug 2015)
1415

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ Structure classes derived from Ruby's [Struct](http://ruby-doc.org/core-2.2.0/St
9191

9292
Thread-safe variables:
9393

94-
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, synchronous, independent state. Based on Clojure's [Atom](http://clojure.org/atoms).
94+
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A way to manage shared, mutable, *asynchronous*, independent, state. Based on Clojure's [Agent](http://clojure.org/agents).
95+
* [Atom](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Atom.html): A way to manage shared, mutable, *synchronous*, independent state. Based on Clojure's [Atom](http://clojure.org/atoms).
9596
* [AtomicBoolean](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicBoolean.html) A boolean value that can be updated atomically.
9697
* [AtomicFixnum](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/AtomicFixnum.html) A numeric value that can be updated atomically.
9798
* [AtomicReference](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/MutexAtomic.html) An object reference that may be updated atomically.
@@ -124,12 +125,11 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
124125

125126
* [Actor](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Actor.html):
126127
Implements the Actor Model, where concurrent actors exchange messages.
127-
* [new Future Framework](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/FutureShortcuts.html) - new
128-
unified implementation of Futures and Promises which combines Features of previous `Future`,
129-
`Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
130-
new synchronization layer to make all the features **non-blocking** and **lock-free** with exception of obviously blocking
128+
* [New Future Framework](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge/FutureShortcuts.html):
129+
Unified implementation of futures and promises which combines features of previous `Future`,
130+
`Promise`, `IVar`, `Event`, `dataflow`, `Delay`, and `TimerTask` into a single framework. It extensively uses the
131+
new synchronization layer to make all the features **non-blocking** and **lock-free**, with the exception of obviously blocking
131132
operations like `#wait`, `#value`. It also offers better performance.
132-
* [Agent](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Agent.html): A single atomic value that represents an identity.
133133
* [Channel](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Channel.html):
134134
Communicating Sequential Processes (CSP).
135135
* [LazyRegister](http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/LazyRegister.html)
@@ -141,12 +141,11 @@ be obeyed though. Features developed in `concurrent-ruby-edge` are expected to m
141141

142142
*Why are these not in core?*
143143

144-
- **Actor** - Partial documentation and tests; stability is good.
144+
- **Actor** - Partial documentation and tests; depends on new future/promise framework; stability is good.
145145
- **Future/Promise Framework** - API changes; partial documentation and tests; stability good.
146-
- **Agent** - Incomplete behaviour compared to Clojure's models; stability good.
147146
- **Channel** - Missing documentation; limited features; stability good.
148147
- **LazyRegister** - Missing documentation and tests.
149-
- **AtomicMarkableReference, LockFreeLinkedSet, LockFreeStack** - Needs real world battle testing
148+
- **AtomicMarkableReference, LockFreeLinkedSet, LockFreeStack** - Need real world battle testing
150149

151150
## Usage
152151

lib/concurrent.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
require 'concurrent/synchronization'
88

99
require 'concurrent/atomic/atomic_reference'
10+
require 'concurrent/agent'
1011
require 'concurrent/atom'
1112
require 'concurrent/array'
1213
require 'concurrent/hash'

0 commit comments

Comments
 (0)