concurrent-ruby 0.7.0.rc2-java → 0.7.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. data/CHANGELOG.md +138 -0
  2. data/README.md +108 -95
  3. data/lib/concurrent/actor.rb +12 -13
  4. data/lib/concurrent/actor/behaviour/errors_on_unknown_message.rb +1 -1
  5. data/lib/concurrent/actor/behaviour/executes_context.rb +1 -1
  6. data/lib/concurrent/actor/behaviour/linking.rb +4 -1
  7. data/lib/concurrent/actor/behaviour/pausing.rb +2 -2
  8. data/lib/concurrent/actor/behaviour/supervised.rb +3 -2
  9. data/lib/concurrent/actor/behaviour/terminates_children.rb +1 -1
  10. data/lib/concurrent/actor/behaviour/termination.rb +1 -1
  11. data/lib/concurrent/actor/context.rb +2 -1
  12. data/lib/concurrent/actor/core.rb +8 -4
  13. data/lib/concurrent/actor/utils.rb +10 -0
  14. data/lib/concurrent/actor/utils/ad_hoc.rb +21 -0
  15. data/lib/concurrent/actor/utils/balancer.rb +42 -0
  16. data/lib/concurrent/actor/utils/broadcast.rb +22 -6
  17. data/lib/concurrent/actor/utils/pool.rb +59 -0
  18. data/lib/concurrent/agent.rb +1 -22
  19. data/lib/concurrent/async.rb +1 -79
  20. data/lib/concurrent/atomic.rb +20 -26
  21. data/lib/concurrent/atomic/atomic_boolean.rb +4 -1
  22. data/lib/concurrent/atomic/atomic_fixnum.rb +4 -1
  23. data/lib/concurrent/atomic/thread_local_var.rb +71 -24
  24. data/lib/concurrent/atomic_reference/jruby.rb +10 -6
  25. data/lib/concurrent/atomic_reference/ruby.rb +14 -10
  26. data/lib/concurrent/atomics.rb +0 -1
  27. data/lib/concurrent/configuration.rb +11 -5
  28. data/lib/concurrent/dataflow.rb +1 -30
  29. data/lib/concurrent/dereferenceable.rb +9 -2
  30. data/lib/concurrent/executor/indirect_immediate_executor.rb +46 -0
  31. data/lib/concurrent/executor/java_thread_pool_executor.rb +2 -4
  32. data/lib/concurrent/executor/ruby_thread_pool_executor.rb +24 -22
  33. data/lib/concurrent/executor/serialized_execution.rb +36 -23
  34. data/lib/concurrent/executor/thread_pool_executor.rb +2 -0
  35. data/lib/concurrent/executor/timer_set.rb +7 -8
  36. data/lib/concurrent/executors.rb +1 -0
  37. data/lib/concurrent/future.rb +7 -29
  38. data/lib/concurrent/ivar.rb +9 -0
  39. data/lib/concurrent/logging.rb +3 -0
  40. data/lib/concurrent/mvar.rb +26 -9
  41. data/lib/concurrent/observable.rb +33 -0
  42. data/lib/concurrent/promise.rb +59 -1
  43. data/lib/concurrent/scheduled_task.rb +1 -0
  44. data/lib/concurrent/timer_task.rb +18 -18
  45. data/lib/concurrent/tvar.rb +3 -1
  46. data/lib/concurrent/version.rb +1 -1
  47. data/lib/concurrent_ruby_ext.jar +0 -0
  48. data/lib/concurrent_ruby_ext.so +0 -0
  49. data/lib/extension_helper.rb +25 -6
  50. metadata +15 -7
  51. data/lib/concurrent/actor/ad_hoc.rb +0 -19
  52. data/lib/concurrent/actor/utills.rb +0 -7
@@ -4,6 +4,8 @@ module Concurrent
4
4
 
5
5
  # A `TVar` is a transactional variable - a single-element container that
6
6
  # is used as part of a transaction - see `Concurrent::atomically`.
7
+ #
8
+ # {include:file:doc/tvar.md}
7
9
  class TVar
8
10
 
9
11
  # Create a new `TVar` with an initial value.
@@ -112,7 +114,7 @@ module Concurrent
112
114
  result = Transaction::ABORTED
113
115
  rescue => e
114
116
  transaction.abort
115
- throw e
117
+ raise e
116
118
  end
117
119
  # If we can commit, break out of the loop
118
120
 
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '0.7.0.rc2'
2
+ VERSION = '0.7.1'
3
3
  end
Binary file
Binary file
@@ -1,9 +1,28 @@
1
- require 'rbconfig'
2
-
3
1
  module Concurrent
4
- def self.use_c_extensions?
5
- host_os = RbConfig::CONFIG['host_os']
6
- ruby_name = RbConfig::CONFIG['ruby_install_name']
7
- (ruby_name =~ /^ruby$/i || host_os =~ /mswin32/i || host_os =~ /mingw32/i)
2
+
3
+ # @!visibility private
4
+ def self.allow_c_extensions?
5
+ defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
6
+ end
7
+
8
+ # @!visibility private
9
+ def self.allow_c_native_class?(clazz)
10
+ allow_c_extensions? && Concurrent.const_defined?(clazz)
11
+ rescue
12
+ false
13
+ end
14
+
15
+ # @!visibility private
16
+ def self.safe_require_c_extensions
17
+ require 'concurrent_ruby_ext' if allow_c_extensions?
18
+ rescue LoadError
19
+ #warn 'Attempted to load C extensions on unsupported platform. Continuing with pure-Ruby.'
20
+ end
21
+
22
+ # @!visibility private
23
+ def self.safe_require_java_extensions
24
+ require 'concurrent_ruby_ext' if RUBY_PLATFORM == 'java'
25
+ rescue LoadError
26
+ #warn 'Attempted to load Java extensions on unsupported platform. Continuing with pure-Ruby.'
8
27
  end
9
28
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.rc2
5
- prerelease: 6
4
+ version: 0.7.1
5
+ prerelease:
6
6
  platform: java
7
7
  authors:
8
8
  - Jerry D'Antonio
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-30 00:00:00.000000000 Z
12
+ date: 2014-12-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |2
15
15
  Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
@@ -20,6 +20,7 @@ extensions: []
20
20
  extra_rdoc_files:
21
21
  - README.md
22
22
  - LICENSE.txt
23
+ - CHANGELOG.md
23
24
  files:
24
25
  - lib/concurrent.rb
25
26
  - lib/concurrent_ruby.rb
@@ -54,7 +55,6 @@ files:
54
55
  - lib/concurrent/tvar.rb
55
56
  - lib/concurrent/utilities.rb
56
57
  - lib/concurrent/version.rb
57
- - lib/concurrent/actor/ad_hoc.rb
58
58
  - lib/concurrent/actor/behaviour.rb
59
59
  - lib/concurrent/actor/context.rb
60
60
  - lib/concurrent/actor/core.rb
@@ -66,7 +66,7 @@ files:
66
66
  - lib/concurrent/actor/reference.rb
67
67
  - lib/concurrent/actor/root.rb
68
68
  - lib/concurrent/actor/type_check.rb
69
- - lib/concurrent/actor/utills.rb
69
+ - lib/concurrent/actor/utils.rb
70
70
  - lib/concurrent/actor/behaviour/abstract.rb
71
71
  - lib/concurrent/actor/behaviour/awaits.rb
72
72
  - lib/concurrent/actor/behaviour/buffer.rb
@@ -80,7 +80,10 @@ files:
80
80
  - lib/concurrent/actor/behaviour/supervising.rb
81
81
  - lib/concurrent/actor/behaviour/terminates_children.rb
82
82
  - lib/concurrent/actor/behaviour/termination.rb
83
+ - lib/concurrent/actor/utils/ad_hoc.rb
84
+ - lib/concurrent/actor/utils/balancer.rb
83
85
  - lib/concurrent/actor/utils/broadcast.rb
86
+ - lib/concurrent/actor/utils/pool.rb
84
87
  - lib/concurrent/atomic/atomic_boolean.rb
85
88
  - lib/concurrent/atomic/atomic_fixnum.rb
86
89
  - lib/concurrent/atomic/condition.rb
@@ -109,6 +112,7 @@ files:
109
112
  - lib/concurrent/executor/executor.rb
110
113
  - lib/concurrent/executor/fixed_thread_pool.rb
111
114
  - lib/concurrent/executor/immediate_executor.rb
115
+ - lib/concurrent/executor/indirect_immediate_executor.rb
112
116
  - lib/concurrent/executor/java_cached_thread_pool.rb
113
117
  - lib/concurrent/executor/java_fixed_thread_pool.rb
114
118
  - lib/concurrent/executor/java_single_thread_executor.rb
@@ -129,6 +133,7 @@ files:
129
133
  - lib/concurrent/utility/timer.rb
130
134
  - README.md
131
135
  - LICENSE.txt
136
+ - CHANGELOG.md
132
137
  - lib/concurrent_ruby_ext.jar
133
138
  homepage: http://www.concurrent-ruby.com
134
139
  licenses:
@@ -145,9 +150,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
150
  none: false
146
151
  required_rubygems_version: !ruby/object:Gem::Requirement
147
152
  requirements:
148
- - - '>'
153
+ - - '>='
149
154
  - !ruby/object:Gem::Version
150
- version: 1.3.1
155
+ version: '0'
156
+ hash: 2
157
+ segments:
158
+ - 0
151
159
  none: false
152
160
  requirements: []
153
161
  rubyforge_project:
@@ -1,19 +0,0 @@
1
- module Concurrent
2
- module Actor
3
- # Allows quick creation of actors with behaviour defined by blocks.
4
- # @example ping
5
- # AdHoc.spawn :forward, an_actor do |where|
6
- # # this block has to return proc defining #on_message behaviour
7
- # -> message { where.tell message }
8
- # end
9
- class AdHoc < Context
10
- def initialize(*args, &initializer)
11
- @on_message = Type! initializer.call(*args), Proc
12
- end
13
-
14
- def on_message(message)
15
- instance_exec message, &@on_message
16
- end
17
- end
18
- end
19
- end
@@ -1,7 +0,0 @@
1
- module Concurrent
2
- module Actor
3
- module Utils
4
- require 'concurrent/actor/utils/broadcast'
5
- end
6
- end
7
- end