async 1.25.2 → 1.26.0

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
  SHA256:
3
- metadata.gz: 81b7571d3f6ac5ce2ade98ca74b0440581178c8cb74503553d5a6dc70956a6fb
4
- data.tar.gz: f5aeea0f0a482f52e98c5064bd9678aed1f9b8e4868ad2d5bf7a79c009f53275
3
+ metadata.gz: d546f73c635b8f801dce53795cd008b1c77012c036ffc36f625ad070a0fad6da
4
+ data.tar.gz: b1314aaf0f5c0390c1a6a4db03f97a0372fcf7ecee7e7e8faf44092164741c65
5
5
  SHA512:
6
- metadata.gz: 9a513e4b8f4efb35cd0438801c2e0dc6896b9f11f911e8cc547a15c22043d28adeb257d47de2d326513095cf813ab88fd9c1aec8c7c7daffef85a8c7238da7f9
7
- data.tar.gz: 84e46d9e07977de42c79297f0c1decf62957497ed6688bdc65b687fee21b26127c7e553c64d09d5e4dcf405dcc46d468b22e689bfb6e69dfac4c541b9608459f
6
+ metadata.gz: 5e72558025db19f21d522ea75dd0d9ba020df444b813612acc6a8648e23a95fb59319a0fbf8bf4185bd808ccd86a3f5d8070ad27eb74231c72c5bfb2f580ab21
7
+ data.tar.gz: ba5c752376b8edd1e6bd8b7c9862ce5b5943529a1b9945e8a7c797ca72e22ed23fde6049999defb15b08dbd5b3aa68177bac5a627d077109002ba0efc7ad3853
@@ -34,7 +34,11 @@ module Async
34
34
 
35
35
  attr :items
36
36
 
37
- def enqueue item
37
+ def empty?
38
+ @items.empty?
39
+ end
40
+
41
+ def enqueue(item)
38
42
  @items.push(item)
39
43
 
40
44
  self.signal unless self.empty?
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Async
24
- VERSION = "1.25.2"
24
+ VERSION = "1.26.0"
25
25
  end
@@ -53,6 +53,10 @@ RSpec.shared_context Async::Queue do
53
53
  end
54
54
  end
55
55
 
56
+ context 'with an empty queue' do
57
+ it {is_expected.to be_empty}
58
+ end
59
+
56
60
  context 'with semaphore' do
57
61
  let(:capacity) {2}
58
62
  let(:semaphore) {Async::Semaphore.new(capacity)}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.2
4
+ version: 1.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-25 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nio4r