concurrent-ruby 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf265efdf2111b4e83c6d8bd20f0d0d3552b746c
4
- data.tar.gz: ead40801aecaef1362729dfd1249757cd671fc83
3
+ metadata.gz: 6a8e5f14e4a1e118dc9f6404da844b670de3529d
4
+ data.tar.gz: 848f7bcded7ff231eac299accd77591ee4c93865
5
5
  SHA512:
6
- metadata.gz: 2af252bdc7618b58f1898fa1562d14dc9e2c28ef7f2b3ee5ee95d91ab4831698f1c3154c782f01b958e46396c1325b1e6393e2118da24d78681f872a30c93d50
7
- data.tar.gz: af77e8aeb320a96f252b8b8ed5d19324ca3886fabaf92cff889750951779023fbf70f5d74b59d0f7a79cba614129b8545671435ef2e35e788010cd52e2178e7e
6
+ metadata.gz: 31c9d60c22b34929e192a274077b322e9712a0eacaa10f3928255aa43d4e74f76b1239ece532083165d293fbd57362199b3cc41b323530ffba15fe9c79f0606a
7
+ data.tar.gz: e26ac84e9f4b1d9051888bfb2c92e908cac2d72a502f8ef4618a5ab560215f9ddf9996935eed52a54043b4bd43264ab79d8a1a4bed3e0c12ce6d902aa5b59c70
@@ -1,4 +1,11 @@
1
- ## Current Release v1.0.1 (27 February 2016)
1
+ ## Current Release v1.0.2 (2 May 2016)
2
+
3
+ * Fix bug with `Concurrent::Map` MRI backend `#inspect` method
4
+ * Fix bug with `Concurrent::Map` MRI backend using `Hash#value?`
5
+ * Improved documentation and examples
6
+ * Minor updates to Edge
7
+
8
+ ### Release v1.0.1 (27 February 2016)
2
9
 
3
10
  * Fix "uninitialized constant Concurrent::ReentrantReadWriteLock" error.
4
11
  * Better handling of `autoload` vs. `require`.
@@ -76,10 +76,6 @@ module Concurrent
76
76
  @backend.key?(key)
77
77
  end
78
78
 
79
- def value?(value)
80
- @backend.value?(value)
81
- end
82
-
83
79
  def delete(key)
84
80
  @backend.delete(key)
85
81
  end
@@ -53,10 +53,6 @@ module Concurrent
53
53
  synchronize { super }
54
54
  end
55
55
 
56
- def value?(value)
57
- synchronize { super }
58
- end
59
-
60
56
  def delete(key)
61
57
  synchronize { super }
62
58
  end
@@ -149,7 +149,7 @@ module Concurrent
149
149
  return true if value.equal?(v)
150
150
  end
151
151
  false
152
- end unless method_defined?(:value?)
152
+ end
153
153
 
154
154
  def keys
155
155
  arr = []
@@ -202,6 +202,15 @@ module Concurrent
202
202
 
203
203
  undef :freeze
204
204
 
205
+ # @!visibility private
206
+ DEFAULT_OBJ_ID_STR_WIDTH = (2**50).class == Fixnum ? 14 : 7 # we want to look "native", 7 for 32-bit, 14 for 64-bit
207
+ # override default #inspect() method: firstly, we don't want to be spilling our guts (i-vars), secondly, MRI backend's
208
+ # #inspect() call on its @backend i-var will bump @backend's iter level while possibly yielding GVL
209
+ def inspect
210
+ id_str = (object_id << 1).to_s(16).rjust(DEFAULT_OBJ_ID_STR_WIDTH, '0')
211
+ "#<#{self.class.name}:0x#{id_str} entries=#{size} default_proc=#{@default_proc.inspect}>"
212
+ end
213
+
205
214
  private
206
215
  def raise_fetch_no_key
207
216
  raise KeyError, 'key not found'
@@ -28,21 +28,22 @@ module Concurrent
28
28
  # When a promise is rejected all its children will be summarily rejected and
29
29
  # will receive the reason.
30
30
  #
31
- # Promises have four possible states: *unscheduled*, *pending*, *rejected*,
32
- # and *fulfilled*. A Promise created using `.new` will be *unscheduled*. It is
33
- # scheduled by calling the `execute` method. Upon execution the Promise and
34
- # all its children will be set to *pending*. When a promise is *pending* it
35
- # will remain in that state until processing is complete. A completed Promise
36
- # is either *rejected*, indicating that an exception was thrown during
37
- # processing, or *fulfilled*, indicating it succeeded. If a Promise is
38
- # *fulfilled* its `value` will be updated to reflect the result of the
39
- # operation. If *rejected* the `reason` will be updated with a reference to
40
- # the thrown exception. The predicate methods `unscheduled?`, `pending?`,
41
- # `rejected?`, and `fulfilled?` can be called at any time to obtain the state
42
- # of the Promise, as can the `state` method, which returns a symbol. A Promise
43
- # created using `.execute` will be *pending*, a Promise created using
44
- # `.fulfill(value)` will be *fulfilled* with the given value and a Promise
45
- # created using `.reject(reason)` will be *rejected* with the given reason.
31
+ # Promises have several possible states: *:unscheduled*, *:pending*,
32
+ # *:processing*, *:rejected*, or *:fulfilled*. These are also aggregated as
33
+ # `#incomplete?` and `#complete?`. When a Promise is created it is set to
34
+ # *:unscheduled*. Once the `#execute` method is called the state becomes
35
+ # *:pending*. Once a job is pulled from the thread pool's queue and is given
36
+ # to a thread for processing (often immediately upon `#post`) the state
37
+ # becomes *:processing*. The future will remain in this state until processing
38
+ # is complete. A future that is in the *:unscheduled*, *:pending*, or
39
+ # *:processing* is considered `#incomplete?`. A `#complete?` Promise is either
40
+ # *:rejected*, indicating that an exception was thrown during processing, or
41
+ # *:fulfilled*, indicating success. If a Promise is *:fulfilled* its `#value`
42
+ # will be updated to reflect the result of the operation. If *:rejected* the
43
+ # `reason` will be updated with a reference to the thrown exception. The
44
+ # predicate methods `#unscheduled?`, `#pending?`, `#rejected?`, and
45
+ # `#fulfilled?` can be called at any time to obtain the state of the Promise,
46
+ # as can the `#state` method, which returns a symbol.
46
47
  #
47
48
  # Retrieving the value of a promise is done through the `value` (alias:
48
49
  # `deref`) method. Obtaining the value of a promise is a potentially blocking
@@ -1,4 +1,4 @@
1
1
  module Concurrent
2
- VERSION = '1.0.1'
3
- EDGE_VERSION = '0.2.1'
2
+ VERSION = '1.0.2'
3
+ EDGE_VERSION = '0.2.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-27 00:00:00.000000000 Z
12
+ date: 2016-05-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |
15
15
  Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.6.0
172
+ rubygems_version: 2.6.4
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala, Haskell,