concurrent-ruby:
Concurrent::Map#compute_if_absent
for fast non-blocking pathconcurrent-ruby:
concurrent-ruby:
concurrent-ruby-edge:
concurrent-ruby:
concurrent-ruby-edge:
concurrent-ruby:
concurrent-ruby-edge:
concurrent-ruby:
concurrent-ruby-edge
to concurrent-ruby
concurrent-ruby
Promise#then
concurrent-ruby-edge:
lib-edge
concurrent-ruby:
concurrent-ruby-edge:
true
concurrent-ruby:
concurrent-ruby-edge:
Concurrent::processor_count
Concurrent::Map
MRI backend #inspect
methodConcurrent::Map
MRI backend using Hash#value?
autoload
vs. require
.Future
zipping.Future
constructor .fork
.TimerTask
did not correctly specify all its dependencies.attr_volatile_with_cas
to attr_atomic
clear_each
to LockFreeStack
AtomicReference
documentationActor
logging.ThreadPoolExecutor
task count methods.Async
performance for both short and long-lived objects.LockFreeLinkedSet
.Agent#await
triggered a validation failure.Channel
updates.ThreadPoolExecutor
task count methodslib/concurrent/constants.rb
Future#flat
Channel
implementation in Edge gem.RubySingleThreadExecutor
Async
improvementsSingleThreadExecutor
instead of the global thread pool.Atom
updatesDereferenceable
Observable
#reset
methodAgent
API and implementation. Now functionally equivalent to Clojure.thread_safe
gemConcurrent::Array
Concurrent::Hash
Concurrent::Map
(formerly ThreadSafe::Cache)Concurrent::Tuple
Exchanger
Atom
aloneThreadLocalVar
on non-JRuby platformsConcurrent.zip
AtomicFixnum
methods #increment
and #decrement
now support optional deltaAtomicFixnum#update
methodReadWriteLock
ReentrantReadWriteLock
classThreadLocalVar#bind
method is now publicAtomicReference
AtomicReference#try_update
now simply returns instead of raising exceptionAtomicReference#try_update!
was added to raise exceptions if an update
fails. Note: this is the same behavior as the old try_update
AtomicBoolean
AtomicFixnum
Semaphore
ScheduledTask
count
in CountDownLatch
to 1Concurrent.monotonic_time
Process.clock_gettime(Process::CLOCK_MONOTONIC)
when availablejava.lang.System.nanoTime()
on unsupported JRuby versionsConcurrent.timer
, Concurrent.timeout
, TimerSet
, TimerTask
, and ScheduledTask
Concurrent.timer
, TimerSet
, and ScheduledTask
ReadWriteLock
classat_exit
behavior for Java and Ruby thread pools.at_exit
handler to Ruby thread pools (already in Java thread pools)ObjectSpace
ObjectSpace
by default so that handler stores the object reference:stop_on_exit
option to thread pools to enable/disable at_exit
handler:executor
option syntax for all abstractions which support this optionExecutor#auto_terminate?
predicate method (for thread pools)at_exit
handler to TimerSet
Concurrent::Configuration
to Concurrent
Actor
causing it to prematurely warm global thread pools on gem loadRejectedExecutionError
bug when running with minitest/autorun via JRubyConcurrent
namespace and refactored the codeDelay
TimerSet
Future
when the handler raises ExceptionAtom
Maybe
ImmutableStruct
MutableStruct
SettableStruct
Actor
Agent
Channel
Exchanger
LazyRegister
Future
,
Promise
, IVar
, Event
, Probe
, dataflow
, Delay
, TimerTask
into single framework. It uses extensively
new synchronization layer to make all the paths lock-free with exception of blocking threads on #wait
.
It offers better performance and does not block threads when not required.[:event_name, *payload]
instead of just the Symbol.IVar
for better interoperability[BehaviourClass1, [BehaviourClass2, *initialization_args]]
supervise: true
is not required any moreactor << job1 << job2 << :terminate!
and
be sure that both jobs are processed first.Channel
to use newer synchronization objects#reset
and #cancel
methods to TimerSet
#cancel
method to Future
and ScheduledTask
TimerSet
to use ScheduledTask
Async
with a factory that initializes the objectConcurrent.timer
and Concurrent.timeout
concurrent-ruby-ext
companion gem.
Please see the README for more detail.Promise
and Future
via an :args
optionSemaphore
class based on java.util.concurrent.SemaphorePromise.all?
and Promise.any?
class methods:overflow_policy
on thread pools to :fallback_policy
:overflow_policy
option but display a warningfallback_policy
behavior when not running (rather than universally rejecting tasks)set_deref_options
constructor bug in Promise
classrequire
bug in ThreadLocalVar
classTimerSet
classTimerSet
classTimerSet#post
methodPlease see the roadmap for more information on the next planned release.
flat_map
method to Promise
zip
method to Promise
Actor
Promise
testsIndirectImmediateExecutor
classThreadLocalVar
(uses Ref
gem on non-JRuby systems)Actor
from using an ImmediateExecutor
(causes deadlock)TimerSet
Concurrent::Actor::Utils::Pool#ask
TimerTask
JavaThreadPoolExecutor
with minimum pool size of zeroMutexAtomic
atomic reference classCAtomic
, JavaAtomic
, and RbxAtomic
CAtomicBoolean
CAtomicFixnum
dataflow!
and dataflow_with!
methods to match Future#value!
methodAgent
Termination
, Pausing
, Linking
, Supervising
, etc. Users can create custom Actors easily based on their needs.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
.:terminated
, :paused
, :restarted
, etc.Concurrent::Actor.root.ask!(:dead_letter_routing)
)Actor
class removed and replaced by new implementation previously called Actress
. Actress
was kept as an alias for Actor
to keep compatibility.Utils::Broadcast
actor which allows Publish–subscribe pattern.SerializedExecution
mixin moduleSerializedExecutionDelegator
for serializing any executorAsync
with serialized executionImmediateExecutor
and PerThreadExecutor
with full executor service lifecycleDelay
to root Actress
initializationexecutor.rb:148 warning: ambiguous Java methods found, using submit(java.lang.Runnable)
RubyCachedThreadPool
overflow policyActor
classConcurrent::Actress
Concurrent::RubyThreadPoolExecutor
Concurrent::Observable
to encapsulate our thread safe observer setsChannel
CachedThreadPool
and FixedThreadPool
SingleThreadExecutor
Current::timer
functionTimerSet
executorAtomicBoolean
ScheduledTask
refactoringPriorityQueue
classesAgent
behavior to more closely match Clojureadd_observer
methodRubyThreadPoolExecutor
Event
TimerTask
now an Executor
instead of a Runnable
FixedThreadPool
and CachedThreadPool
to RubyFixedThreadPool
and RubyCachedThreadPool
JavaFixedThreadPool
and JavaCachedThreadPool
spec/concurrent/fixed_thread_pool_shared.rb
and spec/concurrent/cached_thread_pool_shared.rb
FixedThreadPool
now subclasses RubyFixedThreadPool
or JavaFixedThreadPool
as appropriateCachedThreadPool
now subclasses RubyCachedThreadPool
or JavaCachedThreadPool
as appropriateDelay
classConcurrent::processor_count
helper functionAsync
moduleNullThreadPool
to PerThreadExecutor
Channel
(we are planning a new implementation based on Go)$GLOBAL_THREAD_POOL
in lieu of gem-level configurationRubyThreadPoolExecutor
and JavaThreadPoolExecutor
classes:overflow_policy
(based on Java's reject policies)UsesGlobalThreadPool
in lieu of explicit :executor
option (dependency injection) on Future
, Promise
, and Agent
Concurrent::dataflow_with(executor, *inputs)
method to support executor dependency injection for dataflowTVar
and Concurrent::atomically
Channel
Actor
is deprecated in favor of new experimental actor implementation #73. To avoid namespace collision it is living in Actress
namespace until Actor
is removed in next release.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:
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 for more information.
Specific changes include:
IVar
MVar
ThreadLocalVar
AtomicFixnum
dataflow
Condition
CountDownLatch
DependencyCounter
SafeTaskExecutor
CopyOnNotifyObserverSet
CopyOnWriteObserverSet
Future
updated with execute
APIScheduledTask
updated with execute
APIPromise
APIFuture
now extends IVar
Postable#post?
now returns an IVar
Dereferenceable
Obligation
Supervisor
Event
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.