concurrent-ruby-edge 0.3.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +552 -0
  3. data/LICENSE.txt +18 -18
  4. data/README.md +261 -103
  5. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/abstract.rb +2 -0
  6. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/awaits.rb +2 -0
  7. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/buffer.rb +2 -0
  8. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/errors_on_unknown_message.rb +2 -0
  9. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/executes_context.rb +2 -0
  10. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/linking.rb +2 -0
  11. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/pausing.rb +2 -0
  12. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/removes_child.rb +2 -0
  13. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/sets_results.rb +2 -0
  14. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/supervising.rb +2 -0
  15. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour/termination.rb +3 -1
  16. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/behaviour.rb +1 -1
  17. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/context.rb +3 -1
  18. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/core.rb +5 -4
  19. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/default_dead_letter_handler.rb +2 -0
  20. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/envelope.rb +2 -0
  21. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/errors.rb +2 -0
  22. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/internal_delegations.rb +3 -0
  23. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/reference.rb +9 -8
  24. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/root.rb +3 -0
  25. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/utils/ad_hoc.rb +2 -0
  26. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/utils/balancer.rb +2 -0
  27. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/utils/broadcast.rb +1 -0
  28. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/utils/pool.rb +1 -0
  29. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor.rb +11 -6
  30. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/base.rb +14 -14
  31. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/dropping.rb +1 -0
  32. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/sliding.rb +1 -0
  33. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/unbuffered.rb +1 -1
  34. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/tick.rb +1 -1
  35. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel.rb +3 -2
  36. data/lib/concurrent-ruby-edge/concurrent/edge/cancellation.rb +107 -0
  37. data/lib/concurrent-ruby-edge/concurrent/edge/channel.rb +453 -0
  38. data/lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb +1549 -0
  39. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/edge/lock_free_linked_set/node.rb +2 -2
  40. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/edge/lock_free_linked_set.rb +8 -7
  41. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/edge/lock_free_queue.rb +2 -0
  42. data/lib/{concurrent → concurrent-ruby-edge/concurrent}/edge/old_channel_integration.rb +2 -0
  43. data/lib/concurrent-ruby-edge/concurrent/edge/processing_actor.rb +184 -0
  44. data/lib/concurrent-ruby-edge/concurrent/edge/promises.rb +174 -0
  45. data/lib/concurrent-ruby-edge/concurrent/edge/throttle.rb +229 -0
  46. data/lib/concurrent-ruby-edge/concurrent/edge/version.rb +3 -0
  47. data/lib/concurrent-ruby-edge/concurrent/edge.rb +21 -0
  48. data/lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb +50 -0
  49. data/lib/concurrent-ruby-edge/concurrent/lazy_register.rb +83 -0
  50. data/lib/{concurrent-edge.rb → concurrent-ruby-edge/concurrent-edge.rb} +5 -4
  51. metadata +71 -67
  52. data/lib/concurrent/edge/atomic_markable_reference.rb +0 -184
  53. data/lib/concurrent/edge/cancellation.rb +0 -138
  54. data/lib/concurrent/edge/lock_free_stack.rb +0 -126
  55. data/lib/concurrent/edge/processing_actor.rb +0 -161
  56. data/lib/concurrent/edge/promises.rb +0 -2111
  57. data/lib/concurrent/edge/throttle.rb +0 -192
  58. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/public_delegations.rb +0 -0
  59. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/type_check.rb +0 -0
  60. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/actor/utils.rb +0 -0
  61. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/buffered.rb +0 -0
  62. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/ticker.rb +0 -0
  63. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer/timer.rb +0 -0
  64. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/buffer.rb +0 -0
  65. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector/after_clause.rb +0 -0
  66. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector/default_clause.rb +0 -0
  67. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector/error_clause.rb +0 -0
  68. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector/put_clause.rb +0 -0
  69. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector/take_clause.rb +0 -0
  70. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/channel/selector.rb +0 -0
  71. /data/lib/{concurrent → concurrent-ruby-edge/concurrent}/edge/lock_free_linked_set/window.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: da7e2be8cf30bba4051e8af6b0040d4f4892fae5
4
- data.tar.gz: 70067e829e45a4365fa67fd9306be7658cc65d95
2
+ SHA256:
3
+ metadata.gz: f167a49a3185f5364fd2f6e4c3aa0b677e24027815a0b6680237b6b782de04a6
4
+ data.tar.gz: e4b1aa280e5901d08e2d86d2c75c6a61a58d74eddc6f09800e454356f26b3ef2
5
5
  SHA512:
6
- metadata.gz: ae1e26dc4dd7dcd7df7185aa68d43eb010e6982bc7ea0da112c66c2c65ecf53456e71399145b0dc0c7c1f60a59382f1142224be367ff285d39807df585b85539
7
- data.tar.gz: 0207d055c1c55f1ffe7ff7914acaebc0876b801391c7e0068c12f43beab2f2d6f97ad0c02cce9d7f8a92a2dabe5fe790008f995229d058c875c46b97c2c95b0e
6
+ metadata.gz: d68dba078cb11901127698aa8721c1f4bdb0f5688412ac7bf80b84408768b3687586937b92587b395435a725129b048aba763156282814b26e4e3e39eb2cae48
7
+ data.tar.gz: 704ba13e3e7566beff49e9ef29f33eb1842a8e597e0d2054fec085eb7ff21839878064989894c002327d99ac29e42e38c797d8b118401fbcb40710e12c4040c9
data/CHANGELOG.md ADDED
@@ -0,0 +1,552 @@
1
+ ## Current
2
+
3
+ ## Release v1.2.0 (23 Jan 2023)
4
+
5
+ * (#962) Fix ReentrantReadWriteLock to use the same granularity for locals as for Mutex it uses.
6
+ * (#983) Add FiberLocalVar
7
+ * (#934) concurrent-ruby now supports requiring individual classes (public classes listed in the docs), e.g., `require 'concurrent/map'`
8
+ * (#976) Let `Promises.any_fulfilled_future` take an `Event`
9
+ * Improve documentation of various classes
10
+ * (#975) Set the Ruby compatibility version at 2.3
11
+ * (#972) Remove Rubinius-related code
12
+
13
+ ## Release v1.1.10 (22 Mar 2022)
14
+
15
+ concurrent-ruby:
16
+
17
+ * (#951) Set the Ruby compatibility version at 2.2
18
+ * (#939, #933) The `caller_runs` fallback policy no longer blocks reads from the job queue by worker threads
19
+ * (#938, #761, #652) You can now explicitly `prune_pool` a thread pool (Sylvain Joyeux)
20
+ * (#937, #757, #670) We switched the Yahoo stock API for demos to Alpha Vantage (Gustavo Caso)
21
+ * (#932, #931) We changed how `SafeTaskExecutor` handles local jump errors (Aaron Jensen)
22
+ * (#927) You can use keyword arguments in your initialize when using `Async` (Matt Larraz)
23
+ * (#926, #639) We removed timeout from `TimerTask` because it wasn't sound, and now it's a no-op with a warning (Jacob Atzen)
24
+ * (#919) If you double-lock a re-entrant read-write lock, we promote to locked for writing (zp yuan)
25
+ * (#915) `monotonic_time` now accepts an optional unit parameter, as Ruby's `clock_gettime` (Jean Boussier)
26
+
27
+ ## Release v1.1.9 (5 Jun 2021)
28
+
29
+ concurrent-ruby:
30
+
31
+ * (#866) Child promise state not set to :pending immediately after #execute when parent has completed
32
+ * (#905, #872) Fix RubyNonConcurrentPriorityQueue#delete method
33
+ * (2df0337d) Make sure locks are not shared on shared when objects are dup/cloned
34
+ * (#900, #906, #796, #847, #911) Fix Concurrent::Set tread-safety issues on CRuby
35
+ * (#907) Add new ConcurrentMap backend for TruffleRuby
36
+
37
+ ## Release v1.1.8 (20 January 2021)
38
+
39
+ concurrent-ruby:
40
+
41
+ * (#885) Fix race condition in TVar for stale reads
42
+ * (#884) RubyThreadLocalVar: Do not iterate over hash which might conflict with new pair addition
43
+
44
+ ## Release v1.1.7 (6 August 2020)
45
+
46
+ concurrent-ruby:
47
+
48
+ * (#879) Consider falsy value on `Concurrent::Map#compute_if_absent` for fast non-blocking path
49
+ * (#876) Reset Async queue on forking, makes Async fork-safe
50
+ * (#856) Avoid running problematic code in RubyThreadLocalVar on MRI that occasionally results in segfault
51
+ * (#853) Introduce ThreadPoolExecutor without a Queue
52
+
53
+ ## Release v1.1.6, edge v0.6.0 (10 Feb 2020)
54
+
55
+ concurrent-ruby:
56
+
57
+ * (#841) Concurrent.disable_at_exit_handlers! is no longer needed and was deprecated.
58
+ * (#841) AbstractExecutorService#auto_terminate= was deprecated and has no effect.
59
+ Set :auto_terminate option instead when executor is initialized.
60
+
61
+ ## Release v1.1.6.pre1, edge v0.6.0.pre1 (26 Jan 2020)
62
+
63
+ concurrent-ruby:
64
+
65
+ * (#828) Allow to name executors, the name is also used to name their threads
66
+ * (#838) Implement #dup and #clone for structs
67
+ * (#821) Safer finalizers for thread local variables
68
+ * Documentation fixes
69
+ * (#814) Use Ruby's Etc.nprocessors if available
70
+ * (#812) Fix directory structure not to mess with packaging tools
71
+ * (#840) Fix termination of pools on JRuby
72
+
73
+ concurrent-ruby-edge:
74
+
75
+ * Add WrappingExecutor (#830)
76
+
77
+ ## Release v1.1.5, edge v0.5.0 (10 Mar 2019)
78
+
79
+ concurrent-ruby:
80
+
81
+ * fix potential leak of context on JRuby and Java 7
82
+
83
+ concurrent-ruby-edge:
84
+
85
+ * Add finalized Concurrent::Cancellation
86
+ * Add finalized Concurrent::Throttle
87
+ * Add finalized Concurrent::Promises::Channel
88
+ * Add new Concurrent::ErlangActor
89
+
90
+ ## Release v1.1.4 (14 Dec 2018)
91
+
92
+ * (#780) Remove java_alias of 'submit' method of Runnable to let executor service work on java 11
93
+ * (#776) Fix NameError on defining a struct with a name which is already taken in an ancestor
94
+
95
+ ## Release v1.1.3 (7 Nov 2018)
96
+
97
+ * (#775) fix partial require of the gem (although not officially supported)
98
+
99
+ ## Release v1.1.2 (6 Nov 2018)
100
+
101
+ * (#773) more defensive 1.9.3 support
102
+
103
+ ## Release v1.1.1, edge v0.4.1 (1 Nov 2018)
104
+
105
+ * (#768) add support for 1.9.3 back
106
+
107
+ ## Release v1.1.0, edge v0.4.0 (31 OCt 2018) (yanked)
108
+
109
+ * (#768) yanked because of issues with removed 1.9.3 support
110
+
111
+ ## Release v1.1.0.pre2, edge v0.4.0.pre2 (18 Sep 2018)
112
+
113
+ concurrent-ruby:
114
+
115
+ * fixed documentation and README links
116
+ * fix Set for TruffleRuby and Rubinius
117
+ * use properly supported TruffleRuby APIs
118
+
119
+ concurrent-ruby-edge:
120
+
121
+ * add Promises.zip_futures_over_on
122
+
123
+ ## Release v1.1.0.pre1, edge v0.4.0.pre1 (15 Aug 2018)
124
+
125
+ concurrent-ruby:
126
+
127
+ * requires at least Ruby 2.0
128
+ * [Promises](http://ruby-concurrency.github.io/concurrent-ruby/1.1.0/Concurrent/Promises.html)
129
+ are moved from `concurrent-ruby-edge` to `concurrent-ruby`
130
+ * Add support for TruffleRuby
131
+ * (#734) Fix Array/Hash/Set construction broken on TruffleRuby
132
+ * AtomicReference fixed
133
+ * CI stabilization
134
+ * remove sharp dependency edge -> core
135
+ * remove warnings
136
+ * documentation updates
137
+ * Exchanger is no longer documented as edge since it was already available in
138
+ `concurrent-ruby`
139
+ * (#644) Fix Map#each and #each_pair not returning enumerator outside of MRI
140
+ * (#659) Edge promises fail during error handling
141
+ * (#741) Raise on recursive Delay#value call
142
+ * (#727) #717 fix global IO executor on JRuby
143
+ * (#740) Drop support for CRuby 1.9, JRuby 1.7, Rubinius.
144
+ * (#737) Move AtomicMarkableReference out of Edge
145
+ * (#708) Prefer platform specific memory barriers
146
+ * (#735) Fix wrong expected exception in channel spec assertion
147
+ * (#729) Allow executor option in `Promise#then`
148
+ * (#725) fix timeout check to use timeout_interval
149
+ * (#719) update engine detection
150
+ * (#660) Add specs for Promise#zip/Promise.zip ordering
151
+ * (#654) Promise.zip execution changes
152
+ * (#666) Add thread safe set implementation
153
+ * (#651) #699 #to_s, #inspect should not output negative object IDs.
154
+ * (#685) Avoid RSpec warnings about raise_error
155
+ * (#680) Avoid RSpec monkey patching, persist spec results locally, use RSpec
156
+ v3.7.0
157
+ * (#665) Initialize the monitor for new subarrays on Rubinius
158
+ * (#661) Fix error handling in edge promises
159
+
160
+ concurrent-ruby-edge:
161
+
162
+ * (#659) Edge promises fail during error handling
163
+ * Edge files clearly separated in `lib-edge`
164
+ * added ReInclude
165
+
166
+ ## Release v1.0.5, edge v0.3.1 (26 Feb 2017)
167
+
168
+ concurrent-ruby:
169
+
170
+ * Documentation for Event and Semaphore
171
+ * Use Unsafe#fullFence and #loadFence directly since the shortcuts were removed in JRuby
172
+ * Do not depend on org.jruby.util.unsafe.UnsafeHolder
173
+
174
+ concurrent-ruby-edge:
175
+
176
+ * (#620) Actors on Pool raise an error
177
+ * (#624) Delayed promises did not interact correctly with flatting
178
+ * Fix arguments yielded by callback methods
179
+ * Overridable default executor in promises factory methods
180
+ * Asking actor to terminate will always resolve to `true`
181
+
182
+ ## Release v1.0.4, edge v0.3.0 (27 Dec 2016)
183
+
184
+ concurrent-ruby:
185
+
186
+ * Nothing
187
+
188
+ concurrent-ruby-edge:
189
+
190
+ * New promises' API renamed, lots of improvements, edge bumped to 0.3.0
191
+ * **Incompatible** with previous 0.2.3 version
192
+ * see https://github.com/ruby-concurrency/concurrent-ruby/pull/522
193
+
194
+ ## Release v1.0.3 (17 Dec 2016)
195
+
196
+ * Trigger execution of flattened delayed futures
197
+ * Avoid forking for processor_count if possible
198
+ * Semaphore Mutex and JRuby parity
199
+ * Adds Map#each as alias to Map#each_pair
200
+ * Fix uninitialized instance variables
201
+ * Make Fixnum, Bignum merger ready
202
+ * Allows Promise#then to receive an executor
203
+ * TimerSet now survives a fork
204
+ * Reject promise on any exception
205
+ * Allow ThreadLocalVar to be initialized with a block
206
+ * Support Alpha with `Concurrent::processor_count`
207
+ * Fixes format-security error when compiling ruby_193_compatible.h
208
+ * Concurrent::Atom#swap fixed: reraise the exceptions from block
209
+
210
+ ## Release v1.0.2 (2 May 2016)
211
+
212
+ * Fix bug with `Concurrent::Map` MRI backend `#inspect` method
213
+ * Fix bug with `Concurrent::Map` MRI backend using `Hash#value?`
214
+ * Improved documentation and examples
215
+ * Minor updates to Edge
216
+
217
+ ## Release v1.0.1 (27 February 2016)
218
+
219
+ * Fix "uninitialized constant Concurrent::ReentrantReadWriteLock" error.
220
+ * Better handling of `autoload` vs. `require`.
221
+ * Improved API for Edge `Future` zipping.
222
+ * Fix reference leak in Edge `Future` constructor .
223
+ * Fix bug which prevented thread pools from surviving a `fork`.
224
+ * Fix bug in which `TimerTask` did not correctly specify all its dependencies.
225
+ * Improved support for JRuby+Truffle
226
+ * Improved error messages.
227
+ * Improved documentation.
228
+ * Updated README and CONTRIBUTING.
229
+
230
+ ## Release v1.0.0 (13 November 2015)
231
+
232
+ * Rename `attr_volatile_with_cas` to `attr_atomic`
233
+ * Add `clear_each` to `LockFreeStack`
234
+ * Update `AtomicReference` documentation
235
+ * Further updates and improvements to the synchronization layer.
236
+ * Performance and memory usage performance with `Actor` logging.
237
+ * Fixed `ThreadPoolExecutor` task count methods.
238
+ * Improved `Async` performance for both short and long-lived objects.
239
+ * Fixed bug in `LockFreeLinkedSet`.
240
+ * Fixed bug in which `Agent#await` triggered a validation failure.
241
+ * Further `Channel` updates.
242
+ * Adopted a project Code of Conduct
243
+ * Cleared interpreter warnings
244
+ * Fixed bug in `ThreadPoolExecutor` task count methods
245
+ * Fixed bug in 'LockFreeLinkedSet'
246
+ * Improved Java extension loading
247
+ * Handle Exception children in Edge::Future
248
+ * Continued improvements to channel
249
+ * Removed interpreter warnings.
250
+ * Shared constants now in `lib/concurrent/constants.rb`
251
+ * Refactored many tests.
252
+ * Improved synchronization layer/memory model documentation.
253
+ * Bug fix in Edge `Future#flat`
254
+ * Brand new `Channel` implementation in Edge gem.
255
+ * Simplification of `RubySingleThreadExecutor`
256
+ * `Async` improvements
257
+ - Each object uses its own `SingleThreadExecutor` instead of the global thread pool.
258
+ - No longers supports executor injection
259
+ - Much better documentation
260
+ * `Atom` updates
261
+ - No longer `Dereferenceable`
262
+ - Now `Observable`
263
+ - Added a `#reset` method
264
+ * Brand new `Agent` API and implementation. Now functionally equivalent to Clojure.
265
+ * Continued improvements to the synchronization layer
266
+ * Merged in the `thread_safe` gem
267
+ - `Concurrent::Array`
268
+ - `Concurrent::Hash`
269
+ - `Concurrent::Map` (formerly ThreadSafe::Cache)
270
+ - `Concurrent::Tuple`
271
+ * Minor improvements to Concurrent::Map
272
+ * Complete rewrite of `Exchanger`
273
+ * Removed all deprecated code (classes, methods, constants, etc.)
274
+ * Updated Agent, MutexAtomic, and BufferedChannel to inherit from Synchronization::Object.
275
+ * Many improved tests
276
+ * Some internal reorganization
277
+
278
+ ## Release v0.9.1 (09 August 2015)
279
+
280
+ * Fixed a Rubiniux bug in synchronization object
281
+ * Fixed all interpreter warnings (except circular references)
282
+ * Fixed require statements when requiring `Atom` alone
283
+ * Significantly improved `ThreadLocalVar` on non-JRuby platforms
284
+ * Fixed error handling in Edge `Concurrent.zip`
285
+ * `AtomicFixnum` methods `#increment` and `#decrement` now support optional delta
286
+ * New `AtomicFixnum#update` method
287
+ * Minor optimizations in `ReadWriteLock`
288
+ * New `ReentrantReadWriteLock` class
289
+ * `ThreadLocalVar#bind` method is now public
290
+ * Refactored many tests
291
+
292
+ ## Release v0.9.0 (10 July 2015)
293
+
294
+ * Updated `AtomicReference`
295
+ - `AtomicReference#try_update` now simply returns instead of raising exception
296
+ - `AtomicReference#try_update!` was added to raise exceptions if an update
297
+ fails. Note: this is the same behavior as the old `try_update`
298
+ * Pure Java implementations of
299
+ - `AtomicBoolean`
300
+ - `AtomicFixnum`
301
+ - `Semaphore`
302
+ * Fixed bug when pruning Ruby thread pools
303
+ * Fixed bug in time calculations within `ScheduledTask`
304
+ * Default `count` in `CountDownLatch` to 1
305
+ * Use monotonic clock for all timers via `Concurrent.monotonic_time`
306
+ - Use `Process.clock_gettime(Process::CLOCK_MONOTONIC)` when available
307
+ - Fallback to `java.lang.System.nanoTime()` on unsupported JRuby versions
308
+ - Pure Ruby implementation for everything else
309
+ - Effects `Concurrent.timer`, `Concurrent.timeout`, `TimerSet`, `TimerTask`, and `ScheduledTask`
310
+ * Deprecated all clock-time based timer scheduling
311
+ - Only support scheduling by delay
312
+ - Effects `Concurrent.timer`, `TimerSet`, and `ScheduledTask`
313
+ * Added new `ReadWriteLock` class
314
+ * Consistent `at_exit` behavior for Java and Ruby thread pools.
315
+ * Added `at_exit` handler to Ruby thread pools (already in Java thread pools)
316
+ - Ruby handler stores the object id and retrieves from `ObjectSpace`
317
+ - JRuby disables `ObjectSpace` by default so that handler stores the object reference
318
+ * Added a `:stop_on_exit` option to thread pools to enable/disable `at_exit` handler
319
+ * Updated thread pool docs to better explain shutting down thread pools
320
+ * Simpler `:executor` option syntax for all abstractions which support this option
321
+ * Added `Executor#auto_terminate?` predicate method (for thread pools)
322
+ * Added `at_exit` handler to `TimerSet`
323
+ * Simplified auto-termination of the global executors
324
+ - Can now disable auto-termination of global executors
325
+ - Added shutdown/kill/wait_for_termination variants for global executors
326
+ * Can now disable auto-termination for *all* executors (the nuclear option)
327
+ * Simplified auto-termination of the global executors
328
+ * Deprecated terms "task pool" and "operation pool"
329
+ - New terms are "io executor" and "fast executor"
330
+ - New functions added with new names
331
+ - Deprecation warnings added to functions referencing old names
332
+ * Moved all thread pool related functions from `Concurrent::Configuration` to `Concurrent`
333
+ - Old functions still exist with deprecation warnings
334
+ - New functions have updated names as appropriate
335
+ * All high-level abstractions default to the "io executor"
336
+ * Fixed bug in `Actor` causing it to prematurely warm global thread pools on gem load
337
+ - This also fixed a `RejectedExecutionError` bug when running with minitest/autorun via JRuby
338
+ * Moved global logger up to the `Concurrent` namespace and refactored the code
339
+ * Optimized the performance of `Delay`
340
+ - Fixed a bug in which no executor option on construction caused block execution on a global thread pool
341
+ * Numerous improvements and bug fixes to `TimerSet`
342
+ * Fixed deadlock of `Future` when the handler raises Exception
343
+ * Added shared specs for more classes
344
+ * New concurrency abstractions including:
345
+ - `Atom`
346
+ - `Maybe`
347
+ - `ImmutableStruct`
348
+ - `MutableStruct`
349
+ - `SettableStruct`
350
+ * Created an Edge gem for unstable abstractions including
351
+ - `Actor`
352
+ - `Agent`
353
+ - `Channel`
354
+ - `Exchanger`
355
+ - `LazyRegister`
356
+ - **new Future Framework** <http://ruby-concurrency.github.io/concurrent-ruby/Concurrent/Edge.html> - unified
357
+ implementation of Futures and Promises which combines Features of previous `Future`,
358
+ `Promise`, `IVar`, `Event`, `Probe`, `dataflow`, `Delay`, `TimerTask` into single framework. It uses extensively
359
+ new synchronization layer to make all the paths **lock-free** with exception of blocking threads on `#wait`.
360
+ It offers better performance and does not block threads when not required.
361
+ * Actor framework changes:
362
+ - fixed reset loop in Pool
363
+ - Pool can use any actor as a worker, abstract worker class is no longer needed.
364
+ - Actor events not have format `[:event_name, *payload]` instead of just the Symbol.
365
+ - Actor now uses new Future/Promise Framework instead of `IVar` for better interoperability
366
+ - Behaviour definition array was simplified to `[BehaviourClass1, [BehaviourClass2, *initialization_args]]`
367
+ - Linking behavior responds to :linked message by returning array of linked actors
368
+ - Supervised behavior is removed in favour of just Linking
369
+ - RestartingContext is supervised by default now, `supervise: true` is not required any more
370
+ - Events can be private and public, so far only difference is that Linking will
371
+ pass to linked actors only public messages. Adding private :restarting and
372
+ :resetting events which are send before the actor restarts or resets allowing
373
+ to add callbacks to cleanup current child actors.
374
+ - Print also object_id in Reference to_s
375
+ - Add AbstractContext#default_executor to be able to override executor class wide
376
+ - Add basic IO example
377
+ - Documentation somewhat improved
378
+ - All messages should have same priority. It's now possible to send `actor << job1 << job2 << :terminate!` and
379
+ be sure that both jobs are processed first.
380
+ * Refactored `Channel` to use newer synchronization objects
381
+ * Added `#reset` and `#cancel` methods to `TimerSet`
382
+ * Added `#cancel` method to `Future` and `ScheduledTask`
383
+ * Refactored `TimerSet` to use `ScheduledTask`
384
+ * Updated `Async` with a factory that initializes the object
385
+ * Deprecated `Concurrent.timer` and `Concurrent.timeout`
386
+ * Reduced max threads on pure-Ruby thread pools (abends around 14751 threads)
387
+ * Moved many private/internal classes/modules into "namespace" modules
388
+ * Removed brute-force killing of threads in tests
389
+ * Fixed a thread pool bug when the operating system cannot allocate more threads
390
+
391
+ ## Release v0.8.0 (25 January 2015)
392
+
393
+ * C extension for MRI have been extracted into the `concurrent-ruby-ext` companion gem.
394
+ Please see the README for more detail.
395
+ * Better variable isolation in `Promise` and `Future` via an `:args` option
396
+ * Continued to update intermittently failing tests
397
+
398
+ ## Release v0.7.2 (24 January 2015)
399
+
400
+ * New `Semaphore` class based on [java.util.concurrent.Semaphore](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Semaphore.html)
401
+ * New `Promise.all?` and `Promise.any?` class methods
402
+ * Renamed `:overflow_policy` on thread pools to `:fallback_policy`
403
+ * Thread pools still accept the `:overflow_policy` option but display a warning
404
+ * Thread pools now implement `fallback_policy` behavior when not running (rather than universally rejecting tasks)
405
+ * Fixed minor `set_deref_options` constructor bug in `Promise` class
406
+ * Fixed minor `require` bug in `ThreadLocalVar` class
407
+ * Fixed race condition bug in `TimerSet` class
408
+ * Fixed race condition bug in `TimerSet` class
409
+ * Fixed signal bug in `TimerSet#post` method
410
+ * Numerous non-functional updates to clear warning when running in debug mode
411
+ * Fixed more intermittently failing tests
412
+ * Tests now run on new Travis build environment
413
+ * Multiple documentation updates
414
+
415
+ ## Release v0.7.1 (4 December 2014)
416
+
417
+ Please see the [roadmap](https://github.com/ruby-concurrency/concurrent-ruby/issues/142) for more information on the next planned release.
418
+
419
+ * Added `flat_map` method to `Promise`
420
+ * Added `zip` method to `Promise`
421
+ * Fixed bug with logging in `Actor`
422
+ * Improvements to `Promise` tests
423
+ * Removed actor-experimental warning
424
+ * Added an `IndirectImmediateExecutor` class
425
+ * Allow disabling auto termination of global executors
426
+ * Fix thread leaking in `ThreadLocalVar` (uses `Ref` gem on non-JRuby systems)
427
+ * Fix thread leaking when pruning pure-Ruby thread pools
428
+ * Prevent `Actor` from using an `ImmediateExecutor` (causes deadlock)
429
+ * Added missing synchronizations to `TimerSet`
430
+ * Fixed bug with return value of `Concurrent::Actor::Utils::Pool#ask`
431
+ * Fixed timing bug in `TimerTask`
432
+ * Fixed bug when creating a `JavaThreadPoolExecutor` with minimum pool size of zero
433
+ * Removed confusing warning when not using native extenstions
434
+ * Improved documentation
435
+
436
+ ## Release v0.7.0 (13 August 2014)
437
+
438
+ * Merge the [atomic](https://github.com/ruby-concurrency/atomic) gem
439
+ - Pure Ruby `MutexAtomic` atomic reference class
440
+ - Platform native atomic reference classes `CAtomic`, `JavaAtomic`, and `RbxAtomic`
441
+ - Automated [build process](https://github.com/ruby-concurrency/rake-compiler-dev-box)
442
+ - Fat binary releases for [multiple platforms](https://rubygems.org/gems/concurrent-ruby/versions) including Windows (32/64), Linux (32/64), OS X (64-bit), Solaris (64-bit), and JRuby
443
+ * C native `CAtomicBoolean`
444
+ * C native `CAtomicFixnum`
445
+ * Refactored intermittently failing tests
446
+ * Added `dataflow!` and `dataflow_with!` methods to match `Future#value!` method
447
+ * Better handling of timeout in `Agent`
448
+ * Actor Improvements
449
+ - Fine-grained implementation using chain of behaviors. Each behavior is responsible for single aspect like: `Termination`, `Pausing`, `Linking`, `Supervising`, etc. Users can create custom Actors easily based on their needs.
450
+ - Supervision was added. `RestartingContext` will pause on error waiting on its supervisor to decide what to do next ( options are `:terminate!`, `:resume!`, `:reset!`, `:restart!`). Supervising behavior also supports strategies `:one_for_one` and `:one_for_all`.
451
+ - Linking was added to be able to monitor actor's events like: `:terminated`, `:paused`, `:restarted`, etc.
452
+ - Dead letter routing added. Rejected envelopes are collected in a configurable actor (default: `Concurrent::Actor.root.ask!(:dead_letter_routing)`)
453
+ - Old `Actor` class removed and replaced by new implementation previously called `Actress`. `Actress` was kept as an alias for `Actor` to keep compatibility.
454
+ - `Utils::Broadcast` actor which allows Publish–subscribe pattern.
455
+ * More executors for managing serialized operations
456
+ - `SerializedExecution` mixin module
457
+ - `SerializedExecutionDelegator` for serializing *any* executor
458
+ * Updated `Async` with serialized execution
459
+ * Updated `ImmediateExecutor` and `PerThreadExecutor` with full executor service lifecycle
460
+ * Added a `Delay` to root `Actress` initialization
461
+ * Minor bug fixes to thread pools
462
+ * Refactored many intermittently failing specs
463
+ * Removed Java interop warning `executor.rb:148 warning: ambiguous Java methods found, using submit(java.lang.Runnable)`
464
+ * Fixed minor bug in `RubyCachedThreadPool` overflow policy
465
+ * Updated tests to use [RSpec 3.0](http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3)
466
+ * Removed deprecated `Actor` class
467
+ * Better support for Rubinius
468
+
469
+ ## Release v0.6.1 (14 June 2014)
470
+
471
+ * Many improvements to `Concurrent::Actress`
472
+ * Bug fixes to `Concurrent::RubyThreadPoolExecutor`
473
+ * Fixed several brittle tests
474
+ * Moved documentation to http://ruby-concurrency.github.io/concurrent-ruby/frames.html
475
+
476
+ ## Release v0.6.0 (25 May 2014)
477
+
478
+ * Added `Concurrent::Observable` to encapsulate our thread safe observer sets
479
+ * Improvements to new `Channel`
480
+ * Major improvements to `CachedThreadPool` and `FixedThreadPool`
481
+ * Added `SingleThreadExecutor`
482
+ * Added `Current::timer` function
483
+ * Added `TimerSet` executor
484
+ * Added `AtomicBoolean`
485
+ * `ScheduledTask` refactoring
486
+ * Pure Ruby and JRuby-optimized `PriorityQueue` classes
487
+ * Updated `Agent` behavior to more closely match Clojure
488
+ * Observer sets support block callbacks to the `add_observer` method
489
+ * New algorithm for thread creation in `RubyThreadPoolExecutor`
490
+ * Minor API updates to `Event`
491
+ * Rewritten `TimerTask` now an `Executor` instead of a `Runnable`
492
+ * Fixed many brittle specs
493
+ * Renamed `FixedThreadPool` and `CachedThreadPool` to `RubyFixedThreadPool` and `RubyCachedThreadPool`
494
+ * Created JRuby optimized `JavaFixedThreadPool` and `JavaCachedThreadPool`
495
+ * Consolidated fixed thread pool tests into `spec/concurrent/fixed_thread_pool_shared.rb` and `spec/concurrent/cached_thread_pool_shared.rb`
496
+ * `FixedThreadPool` now subclasses `RubyFixedThreadPool` or `JavaFixedThreadPool` as appropriate
497
+ * `CachedThreadPool` now subclasses `RubyCachedThreadPool` or `JavaCachedThreadPool` as appropriate
498
+ * New `Delay` class
499
+ * `Concurrent::processor_count` helper function
500
+ * New `Async` module
501
+ * Renamed `NullThreadPool` to `PerThreadExecutor`
502
+ * Deprecated `Channel` (we are planning a new implementation based on [Go](http://golangtutorials.blogspot.com/2011/06/channels-in-go.html))
503
+ * Added gem-level [configuration](http://robots.thoughtbot.com/mygem-configure-block)
504
+ * Deprecated `$GLOBAL_THREAD_POOL` in lieu of gem-level configuration
505
+ * Removed support for Ruby [1.9.2](https://www.ruby-lang.org/en/news/2013/12/17/maintenance-of-1-8-7-and-1-9-2/)
506
+ * New `RubyThreadPoolExecutor` and `JavaThreadPoolExecutor` classes
507
+ * All thread pools now extend the appropriate thread pool executor classes
508
+ * All thread pools now support `:overflow_policy` (based on Java's [reject policies](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html))
509
+ * Deprecated `UsesGlobalThreadPool` in lieu of explicit `:executor` option (dependency injection) on `Future`, `Promise`, and `Agent`
510
+ * Added `Concurrent::dataflow_with(executor, *inputs)` method to support executor dependency injection for dataflow
511
+ * Software transactional memory with `TVar` and `Concurrent::atomically`
512
+ * First implementation of [new, high-performance](https://github.com/ruby-concurrency/concurrent-ruby/pull/49) `Channel`
513
+ * `Actor` is deprecated in favor of new experimental actor implementation [#73](https://github.com/ruby-concurrency/concurrent-ruby/pull/73). To avoid namespace collision it is living in `Actress` namespace until `Actor` is removed in next release.
514
+
515
+ ## Release v0.5.0
516
+
517
+ This is the most significant release of this gem since its inception. This release includes many improvements and optimizations. It also includes several bug fixes. The major areas of focus for this release were:
518
+
519
+ * Stability improvements on Ruby versions with thread-level parallelism ([JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/))
520
+ * Creation of new low-level concurrency abstractions
521
+ * Internal refactoring to use the new low-level abstractions
522
+
523
+ Most of these updates had no effect on the gem API. There are a few notable exceptions which were unavoidable. Please read the [release notes](API-Updates-in-v0.5.0) for more information.
524
+
525
+ Specific changes include:
526
+
527
+ * New class `IVar`
528
+ * New class `MVar`
529
+ * New class `ThreadLocalVar`
530
+ * New class `AtomicFixnum`
531
+ * New class method `dataflow`
532
+ * New class `Condition`
533
+ * New class `CountDownLatch`
534
+ * New class `DependencyCounter`
535
+ * New class `SafeTaskExecutor`
536
+ * New class `CopyOnNotifyObserverSet`
537
+ * New class `CopyOnWriteObserverSet`
538
+ * `Future` updated with `execute` API
539
+ * `ScheduledTask` updated with `execute` API
540
+ * New `Promise` API
541
+ * `Future` now extends `IVar`
542
+ * `Postable#post?` now returns an `IVar`
543
+ * Thread safety fixes to `Dereferenceable`
544
+ * Thread safety fixes to `Obligation`
545
+ * Thread safety fixes to `Supervisor`
546
+ * Thread safety fixes to `Event`
547
+ * Various other thread safety (race condition) fixes
548
+ * Refactored brittle tests
549
+ * Implemented pending tests
550
+ * Added JRuby and Rubinius as Travis CI build targets
551
+ * Added [CodeClimate](https://codeclimate.com/) code review
552
+ * Improved YARD documentation
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
1
  Copyright (c) Jerry D'Antonio -- released under the MIT license.
2
2
 
3
- http://www.opensource.org/licenses/mit-license.php
3
+ http://www.opensource.org/licenses/mit-license.php
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.