concurrent-ruby 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +8 -1
 - data/lib/concurrent/collection/map/non_concurrent_map_backend.rb +0 -4
 - data/lib/concurrent/collection/map/synchronized_map_backend.rb +0 -4
 - data/lib/concurrent/map.rb +10 -1
 - data/lib/concurrent/promise.rb +16 -15
 - data/lib/concurrent/version.rb +2 -2
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6a8e5f14e4a1e118dc9f6404da844b670de3529d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 848f7bcded7ff231eac299accd77591ee4c93865
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 31c9d60c22b34929e192a274077b322e9712a0eacaa10f3928255aa43d4e74f76b1239ece532083165d293fbd57362199b3cc41b323530ffba15fe9c79f0606a
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: e26ac84e9f4b1d9051888bfb2c92e908cac2d72a502f8ef4618a5ab560215f9ddf9996935eed52a54043b4bd43264ab79d8a1a4bed3e0c12ce6d902aa5b59c70
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,4 +1,11 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ## Current Release v1.0. 
     | 
| 
      
 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`.
         
     | 
    
        data/lib/concurrent/map.rb
    CHANGED
    
    | 
         @@ -149,7 +149,7 @@ module Concurrent 
     | 
|
| 
       149 
149 
     | 
    
         
             
                    return true if value.equal?(v)
         
     | 
| 
       150 
150 
     | 
    
         
             
                  end
         
     | 
| 
       151 
151 
     | 
    
         
             
                  false
         
     | 
| 
       152 
     | 
    
         
            -
                end 
     | 
| 
      
 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'
         
     | 
    
        data/lib/concurrent/promise.rb
    CHANGED
    
    | 
         @@ -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  
     | 
| 
       32 
     | 
    
         
            -
              #  
     | 
| 
       33 
     | 
    
         
            -
              #  
     | 
| 
       34 
     | 
    
         
            -
              #  
     | 
| 
       35 
     | 
    
         
            -
              #  
     | 
| 
       36 
     | 
    
         
            -
              #  
     | 
| 
       37 
     | 
    
         
            -
              # processing 
     | 
| 
       38 
     | 
    
         
            -
              #  
     | 
| 
       39 
     | 
    
         
            -
              #  
     | 
| 
       40 
     | 
    
         
            -
              #  
     | 
| 
       41 
     | 
    
         
            -
              #  
     | 
| 
       42 
     | 
    
         
            -
              #  
     | 
| 
       43 
     | 
    
         
            -
              #  
     | 
| 
       44 
     | 
    
         
            -
              #  
     | 
| 
       45 
     | 
    
         
            -
              #  
     | 
| 
      
 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
         
     | 
    
        data/lib/concurrent/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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 
     | 
| 
      
 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. 
     | 
| 
      
 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,
         
     |