timers 4.1.2 → 4.3.5

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.
metadata CHANGED
@@ -1,23 +1,82 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timers
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.2
4
+ version: 4.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
- autorequire:
8
+ - Samuel Williams
9
+ - "//de"
10
+ - Wander Hillen
11
+ - Jeremy Hinegardner
12
+ - skinnyjames
13
+ - Chuck Remes
14
+ - utenmiki
15
+ - Olle Jonsson
16
+ - deadprogrammer
17
+ - takiy33
18
+ - Larry Lv
19
+ - Lin Jen-Shin
20
+ - Ryunosuke SATO
21
+ - Tommy Ong Gia Phu
22
+ - Atul Bhosale
23
+ - Bruno Enten
24
+ - Dimitrij Denissenko
25
+ - Donovan Keme
26
+ - Feram
27
+ - Jesse Cooke
28
+ - Klaus Trainer
29
+ - Lavir the Whiolet
30
+ - Mike Bourgeous
31
+ - Ryan LeCompte
32
+ - Tim Smith
33
+ - Vít Ondruch
34
+ - Will Jessop
35
+ - Yoshiki Takagi
36
+ - nicholas a. evans
37
+ - tommyogp
38
+ autorequire:
9
39
  bindir: bin
10
- cert_chain: []
11
- date: 2016-11-26 00:00:00.000000000 Z
40
+ cert_chain:
41
+ - |
42
+ -----BEGIN CERTIFICATE-----
43
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
44
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
45
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
46
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
47
+ MBsGCgmSJomT8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dc+FhgqI5lMon6tt9rNeXmnW/
63
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
64
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
65
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
66
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
67
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
68
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
69
+ -----END CERTIFICATE-----
70
+ date: 2022-10-12 00:00:00.000000000 Z
12
71
  dependencies:
13
72
  - !ruby/object:Gem::Dependency
14
- name: hitimes
73
+ name: bundler
15
74
  requirement: !ruby/object:Gem::Requirement
16
75
  requirements:
17
76
  - - ">="
18
77
  - !ruby/object:Gem::Version
19
78
  version: '0'
20
- type: :runtime
79
+ type: :development
21
80
  prerelease: false
22
81
  version_requirements: !ruby/object:Gem::Requirement
23
82
  requirements:
@@ -25,7 +84,7 @@ dependencies:
25
84
  - !ruby/object:Gem::Version
26
85
  version: '0'
27
86
  - !ruby/object:Gem::Dependency
28
- name: bundler
87
+ name: covered
29
88
  requirement: !ruby/object:Gem::Requirement
30
89
  requirements:
31
90
  - - ">="
@@ -38,46 +97,69 @@ dependencies:
38
97
  - - ">="
39
98
  - !ruby/object:Gem::Version
40
99
  version: '0'
41
- description: Schedule procs to run after a certain time, or at periodic intervals,
42
- using any API that accepts a timeout.
100
+ - !ruby/object:Gem::Dependency
101
+ name: bake-test
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '0.1'
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '0.1'
114
+ - !ruby/object:Gem::Dependency
115
+ name: bake-test-external
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '0.2'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '0.2'
128
+ - !ruby/object:Gem::Dependency
129
+ name: sus
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '0.13'
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '0.13'
142
+ description:
43
143
  email:
44
- - bascule@gmail.com
45
144
  executables: []
46
145
  extensions: []
47
146
  extra_rdoc_files: []
48
147
  files:
49
- - ".coveralls.yml"
50
- - ".gitignore"
51
- - ".rspec"
52
- - ".rubocop.yml"
53
- - ".ruby-version"
54
- - ".travis.yml"
55
- - AUTHORS.md
56
- - CHANGES.md
57
- - Gemfile
58
- - LICENSE
59
- - README.md
60
- - Rakefile
61
148
  - lib/timers.rb
62
149
  - lib/timers/events.rb
63
150
  - lib/timers/group.rb
151
+ - lib/timers/interval.rb
152
+ - lib/timers/priority_heap.rb
64
153
  - lib/timers/timer.rb
65
154
  - lib/timers/version.rb
66
155
  - lib/timers/wait.rb
67
- - spec/spec_helper.rb
68
- - spec/timers/cancel_spec.rb
69
- - spec/timers/events_spec.rb
70
- - spec/timers/every_spec.rb
71
- - spec/timers/group_spec.rb
72
- - spec/timers/performance_spec.rb
73
- - spec/timers/strict_spec.rb
74
- - spec/timers/wait_spec.rb
75
- - timers.gemspec
76
- homepage: https://github.com/celluloid/timers
156
+ - license.md
157
+ - readme.md
158
+ homepage: https://github.com/socketry/timers
77
159
  licenses:
78
160
  - MIT
79
161
  metadata: {}
80
- post_install_message:
162
+ post_install_message:
81
163
  rdoc_options: []
82
164
  require_paths:
83
165
  - lib
@@ -92,17 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
174
  - !ruby/object:Gem::Version
93
175
  version: '0'
94
176
  requirements: []
95
- rubyforge_project:
96
- rubygems_version: 2.5.2
97
- signing_key:
177
+ rubygems_version: 3.3.7
178
+ signing_key:
98
179
  specification_version: 4
99
- summary: Pure Ruby one-shot and periodic timers
100
- test_files:
101
- - spec/spec_helper.rb
102
- - spec/timers/cancel_spec.rb
103
- - spec/timers/events_spec.rb
104
- - spec/timers/every_spec.rb
105
- - spec/timers/group_spec.rb
106
- - spec/timers/performance_spec.rb
107
- - spec/timers/strict_spec.rb
108
- - spec/timers/wait_spec.rb
180
+ summary: Pure Ruby one-shot and periodic timers.
181
+ test_files: []
metadata.gz.sig ADDED
Binary file
data/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- service-name: travis-pro
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
data/.rspec DELETED
@@ -1,6 +0,0 @@
1
- --color
2
- --format documentation
3
- --backtrace
4
- --order random
5
- --warnings
6
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,28 +0,0 @@
1
- AllCops:
2
- DisplayCopNames: true
3
-
4
- #
5
- # Style
6
- #
7
-
8
- LineLength:
9
- Max: 128
10
-
11
- Style/NumericPredicate:
12
- Enabled: false
13
-
14
- Style/SafeNavigation:
15
- Enabled: false
16
-
17
- Style/StringLiterals:
18
- EnforcedStyle: double_quotes
19
-
20
- #
21
- # Metrics
22
- #
23
-
24
- Metrics/ClassLength:
25
- Max: 100
26
-
27
- Metrics/MethodLength:
28
- Max: 25
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.3
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- bundler_args: --without development doc
5
-
6
- rvm:
7
- - 2.0.0
8
- - 2.1.10
9
- - 2.2.6
10
- - 2.3.3
11
- - jruby-9.1.6.0
12
-
13
- matrix:
14
- fast_finish: true
15
-
16
- branches:
17
- only:
18
- - master
19
-
20
- notifications:
21
- irc: "irc.freenode.org#celluloid"
data/AUTHORS.md DELETED
@@ -1,15 +0,0 @@
1
- # The Celluloid timers gem is beamed directly to you from the minds of...
2
-
3
- - Tony Arcieri <bascule@gmail.com>
4
- - Jeremy Hinegardner
5
- - Sean Gregory
6
- - Chuck Remes
7
- - Utenmiki
8
- - Ron Evans
9
- - Larry Lv
10
- - Bruno Enten
11
- - Jesse Cooke
12
- - Nicholas Evans
13
- - Dimitrij Denissenko
14
- - Ryan LeCompte
15
- - Samuel G. D. Williams
data/CHANGES.md DELETED
@@ -1,62 +0,0 @@
1
- ## 4.1.2 (2016-11-26)
2
-
3
- * RuboCop reformatting
4
-
5
- ## 4.1.1 (2015-08-21)
6
-
7
- * Remove `RubyProf` from Gemfile and a test, due to it providing no substantial benefit while increasing problems building bundles under Rubinius.
8
-
9
- ## 4.1.0 (2015-08-16)
10
-
11
- * Addition of `now_and_every` method; fires block immediately, then sets recurring timer.
12
- * Includes `now_and_after` method; does the same as above for one-shot timers: essentially a "two-shot" timer.
13
-
14
- # 4.0.4 (2015-09-01)
15
-
16
- * Re-release of the `4.1.1` version under the `4.0.4` designation to work-around issues caused by yanking `4.0.2` a couple weeks ago.
17
-
18
- ## 4.0.1 (2014-09-10)
19
-
20
- * Memory leak fixes
21
- * mathn fix for those crazy enough to use it
22
-
23
- ## 4.0.0 (2014-07-27)
24
-
25
- * Replace Timers::Timeout with Timers::Wait
26
- * Timers::Group#wait_interval now returns nil when no timers, a positive or
27
- negative interval which if positive is the amount of time required to wait
28
- and if negative, how far in the past the latest timer should have fired
29
- * Performance improvements
30
-
31
- ## 3.0.1 (2014-06-27)
32
-
33
- * Require 'set' automatically
34
-
35
- # 3.0.0 (2014-06-14)
36
-
37
- * Refactor `Timers` class into `Timers::Group`
38
- * Add `Timers::Timeout` class for implementing timeouts
39
- * Fix timer fudging
40
- * Update to RSpec 3
41
-
42
- ## 2.0.0 (2013-12-30)
43
-
44
- * Switch to Hitimes for high precision monotonic counters
45
- * Removed Timers#time. Replaced with Timers#current_offset which provides a
46
- monotonic time counter.
47
-
48
- ## 1.1.0
49
-
50
- * Timers#after_milliseconds and #after_ms for waiting in milliseconds
51
-
52
- ## 1.0.2
53
-
54
- * Handle overdue timers correctly
55
-
56
- ## 1.0.1
57
-
58
- * Explicitly require Forwardable from stdlib
59
-
60
- ## 1.0.0
61
-
62
- * Initial release
data/Gemfile DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- group :development do
8
- gem "pry", require: false
9
- end
10
-
11
- group :test do
12
- gem "rspec", "~> 3", require: false
13
- gem "rubocop", "0.45.0", require: false
14
- gem "coveralls", require: false
15
- end
16
-
17
- group :development, :test do
18
- gem "rake"
19
- end
data/LICENSE DELETED
@@ -1,23 +0,0 @@
1
- Copyright (c) 2012-16 The Celluloid Timers Developers: given in the file
2
- AUTHORS.md at https://github.com/celluloid/timers/blob/master/AUTHORS.md
3
-
4
- MIT License
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining
7
- a copy of this software and associated documentation files (the
8
- "Software"), to deal in the Software without restriction, including
9
- without limitation the rights to use, copy, modify, merge, publish,
10
- distribute, sublicense, and/or sell copies of the Software, and to
11
- permit persons to whom the Software is furnished to do so, subject to
12
- the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
- require "bundler/gem_tasks"
3
-
4
- require "rspec/core/rake_task"
5
- RSpec::Core::RakeTask.new
6
-
7
- require "rubocop/rake_task"
8
- RuboCop::RakeTask.new
9
-
10
- task default: %w(spec rubocop)
data/spec/spec_helper.rb DELETED
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "coveralls"
4
- Coveralls.wear!
5
-
6
- require "bundler/setup"
7
- require "timers"
8
-
9
- # Level of accuracy enforced by tests (50ms)
10
- TIMER_QUANTUM = 0.05
11
-
12
- RSpec.configure do |config|
13
- # Setting this config option `false` removes rspec-core's monkey patching of the
14
- # top level methods like `describe`, `shared_examples_for` and `shared_context`
15
- # on `main` and `Module`. The methods are always available through the `RSpec`
16
- # module like `RSpec.describe` regardless of this setting.
17
- # For backwards compatibility this defaults to `true`.
18
- #
19
- # https://relishapp.com/rspec/rspec-core/v/3-0/docs/configuration/global-namespace-dsl
20
- config.expose_dsl_globally = false
21
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Timers::Group do
4
- it "should be able to cancel twice" do
5
- fired = false
6
-
7
- timer = subject.after(0.1) { fired = true }
8
-
9
- 2.times do
10
- timer.cancel
11
- subject.wait
12
- end
13
-
14
- expect(fired).to be false
15
- end
16
-
17
- it "should be possble to reset after cancel" do
18
- fired = false
19
-
20
- timer = subject.after(0.1) { fired = true }
21
- timer.cancel
22
-
23
- subject.wait
24
-
25
- timer.reset
26
-
27
- subject.wait
28
-
29
- expect(fired).to be true
30
- end
31
-
32
- it "should cancel and remove one shot timers after they fire" do
33
- x = 0
34
-
35
- Timers::Wait.for(2) do |_remaining|
36
- timer = subject.every(0.2) { x += 1 }
37
- subject.after(0.1) { timer.cancel }
38
-
39
- subject.wait
40
- end
41
-
42
- expect(subject.timers).to be_empty
43
- expect(x).to be == 0
44
- end
45
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Timers::Events do
4
- it "should register an event" do
5
- fired = false
6
-
7
- callback = proc do |_time|
8
- fired = true
9
- end
10
-
11
- subject.schedule(0.1, callback)
12
-
13
- expect(subject.size).to be == 1
14
-
15
- subject.fire(0.15)
16
-
17
- expect(subject.size).to be == 0
18
-
19
- expect(fired).to be true
20
- end
21
-
22
- it "should register events in order" do
23
- fired = []
24
-
25
- times = [0.95, 0.1, 0.3, 0.5, 0.4, 0.2, 0.01, 0.9]
26
-
27
- times.each do |requested_time|
28
- callback = proc do |_time|
29
- fired << requested_time
30
- end
31
-
32
- subject.schedule(requested_time, callback)
33
- end
34
-
35
- subject.fire(0.5)
36
- expect(fired).to be == times.sort.first(6)
37
-
38
- subject.fire(1.0)
39
- expect(fired).to be == times.sort
40
- end
41
-
42
- it "should fire events with the time they were fired at" do
43
- fired_at = :not_fired
44
-
45
- callback = proc do |time|
46
- # The time we actually were fired at:
47
- fired_at = time
48
- end
49
-
50
- subject.schedule(0.5, callback)
51
-
52
- subject.fire(1.0)
53
-
54
- expect(fired_at).to be == 1.0
55
- end
56
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe Timers::Group do
4
- it "should fire several times" do
5
- result = []
6
-
7
- subject.every(0.7) { result << :a }
8
- subject.every(2.3) { result << :b }
9
- subject.every(1.3) { result << :c }
10
- subject.every(2.4) { result << :d }
11
-
12
- Timers::Wait.for(2.5) do |remaining|
13
- subject.wait if subject.wait_interval < remaining
14
- end
15
-
16
- expect(result).to be == [:a, :c, :a, :a, :b, :d]
17
- end
18
-
19
- it "should fire immediately and then several times later" do
20
- result = []
21
-
22
- subject.every(0.7) { result << :a }
23
- subject.every(2.3) { result << :b }
24
- subject.now_and_every(1.3) { result << :c }
25
- subject.now_and_every(2.4) { result << :d }
26
-
27
- Timers::Wait.for(2.5) do |remaining|
28
- subject.wait if subject.wait_interval < remaining
29
- end
30
-
31
- expect(result).to be == [:c, :d, :a, :c, :a, :a, :b, :d]
32
- end
33
- end