libuv 3.1.8 → 3.1.9

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: b2bf62b9352f506b7f08623378f3bb88bdf69965
4
- data.tar.gz: 8f2c656442685278477856e7baace15a91dd5fa9
3
+ metadata.gz: 9fa444336638ad13d76688a5cb3b497a7583b452
4
+ data.tar.gz: 5873c7caef9490d06fc0a115190b2d503fbbd7b3
5
5
  SHA512:
6
- metadata.gz: a961fa1d1473f7c2fc627d694ff2f0e4901835e7f1d1b791fa11510441f92defdc34d80d885a94e39909909a79307e95551784f3ae24149bc352012b9ea5c7e3
7
- data.tar.gz: bfe72acad743935436cfad7ea7a020eea0d319d3336cf1ce83562f9d436ff734214dd3e7f3f995a6a27af60e8c6503bd1db6bc8067ab1c9fe857a8821c07eb60
6
+ metadata.gz: 6f6061acb31cd5b6621c2ce2b4f22984facb29f211523a9aa3ddea2dc21c237bb96a0eeeb1abb0f1c3893b8364a1a7fba876722d9a174306a23e0bbbd5cfda06
7
+ data.tar.gz: da178e269d1724cf912fa9e4b2180b2657894a151b219fcb4638e4ad34c896f2fe852024c2595fc457a843cd4d1b3bf2b7efdbb6769ef8cde8d6839e5ec03d08
@@ -142,6 +142,11 @@ module Libuv
142
142
  :st_birthtim, UvTimespec
143
143
  end
144
144
 
145
+ class UvLoop < FFI::Struct
146
+ layout :data, :pointer,
147
+ :active_handles, :uint
148
+ end
149
+
145
150
  typedef :pointer, :sockaddr_in
146
151
  typedef :pointer, :uv_handle_t
147
152
  typedef :pointer, :uv_fs_event_t
data/lib/libuv/reactor.rb CHANGED
@@ -217,6 +217,12 @@ module Libuv
217
217
  end
218
218
  end
219
219
 
220
+ # Return the number of active handles in the event loop
221
+ def active_handles
222
+ uvloop = Ext::UvLoop.new @pointer
223
+ uvloop[:active_handles]
224
+ end
225
+
220
226
 
221
227
  # Provides a promise notifier for receiving un-handled exceptions
222
228
  #
data/lib/libuv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Libuv
4
- VERSION = '3.1.8'
4
+ VERSION = '3.1.9'
5
5
  end
data/spec/idle_spec.rb CHANGED
@@ -34,6 +34,8 @@ describe Libuv::Idle do
34
34
  @timeout.close
35
35
  @reactor.stop
36
36
  }.start(1000)
37
+
38
+ expect(@reactor.active_handles).to eq(4)
37
39
  }
38
40
 
39
41
  expect(@general_failure).to eq([])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libuv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.8
4
+ version: 3.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach