fiber_connection_pool 0.3.1 → 0.3.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.
Files changed (3) hide show
  1. data/lib/fiber_connection_pool.rb +8 -3
  2. metadata +20 -15
  3. checksums.yaml +0 -7
@@ -2,7 +2,7 @@ require 'fiber'
2
2
  require_relative 'fiber_connection_pool/exceptions'
3
3
 
4
4
  class FiberConnectionPool
5
- VERSION = '0.3.1'
5
+ VERSION = '0.3.2'
6
6
 
7
7
  RESERVED_TTL_SECS = 30 # reserved cleanup trigger
8
8
  SAVED_DATA_TTL_SECS = 30 # saved_data cleanup trigger
@@ -125,6 +125,7 @@ class FiberConnectionPool
125
125
  @reserved[fiber] = new_conn
126
126
  else
127
127
  @available.unshift new_conn # or else release into the pool
128
+ notify_new_is_available
128
129
  end
129
130
  end
130
131
 
@@ -189,13 +190,17 @@ class FiberConnectionPool
189
190
  # try cleanup
190
191
  reserved_cleanup if (Time.now - @last_reserved_cleanup) >= RESERVED_TTL_SECS
191
192
 
193
+ notify_new_is_available
194
+ end
195
+
196
+ private
197
+
198
+ def notify_new_is_available
192
199
  if pending = @pending.shift
193
200
  pending.resume
194
201
  end
195
202
  end
196
203
 
197
- private
198
-
199
204
  # Choose first available connection and pass it to the supplied
200
205
  # block. This will block (yield) indefinitely until there is an available
201
206
  # connection to service the request.
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiber_connection_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Ruben Caro
@@ -9,40 +10,43 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-09-25 00:00:00.000000000 Z
13
+ date: 2013-09-27 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: minitest
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: rake
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
- description: |-
43
- Fiber-based generic connection pool for Ruby, allowing
44
- non-blocking IO behaviour on the same thread
45
- as provided by EventMachine or Celluloid.
47
+ description: ! "Fiber-based generic connection pool for Ruby, allowing\n non-blocking
48
+ IO behaviour on the same thread\n as provided by EventMachine or
49
+ Celluloid."
46
50
  email:
47
51
  - ruben.caro@lanuez.org
48
52
  executables: []
@@ -81,26 +85,27 @@ files:
81
85
  homepage: https://github.com/rubencaro/fiber_connection_pool
82
86
  licenses:
83
87
  - GPLv3
84
- metadata: {}
85
88
  post_install_message:
86
89
  rdoc_options: []
87
90
  require_paths:
88
91
  - lib
89
92
  required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
90
94
  requirements:
91
- - - '>='
95
+ - - ! '>='
92
96
  - !ruby/object:Gem::Version
93
97
  version: 1.9.2
94
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
+ none: false
95
100
  requirements:
96
- - - '>='
101
+ - - ! '>='
97
102
  - !ruby/object:Gem::Version
98
103
  version: '0'
99
104
  requirements: []
100
105
  rubyforge_project:
101
- rubygems_version: 2.0.6
106
+ rubygems_version: 1.8.25
102
107
  signing_key:
103
- specification_version: 4
108
+ specification_version: 3
104
109
  summary: Fiber-based generic connection pool for Ruby
105
110
  test_files:
106
111
  - test/fiber_connection_pool_test.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 11dbf1d76b0a43dd34325a66e350d16d0bd27ded
4
- data.tar.gz: b1af865a443903cca63885dc8f3a262e13dc96b6
5
- SHA512:
6
- metadata.gz: 3c6e61ff7b08b2163cf10057c9d2e84be87577e6d5fcdee5e90472f560f77fef2174da09cbe40a0e886bc8b9c580460f7e92a1f2e0d32b965acb2f220004ee4e
7
- data.tar.gz: 01659369b1a7079d945c048df1330e6ba02245af2f86e2626014a514dc7e3609f053b6453e9e4f7d68f7aabd8312cbf2d3d29361d8e39609b9fcad6710bcd604