libuv 0.11.18 → 0.11.19

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: 52d38595bf236db2b42ddef34fc7e155adfde67a
4
- data.tar.gz: 777bb7bfb0b28d2cc40824a038b8226baede054d
3
+ metadata.gz: 336a0c0476d19190a108a8e7be9513be3d5f3446
4
+ data.tar.gz: 5fcd039e7c42068f1bcfbea5ba3db0020cc049d8
5
5
  SHA512:
6
- metadata.gz: 431ae6e5b77407b13790db04fc6c782c63952b86c83686399f49467b69790dbcb9c3b628e590a93cf1d340297d4cc5d1fdfcd628c97003f9c43e8b92978ea888
7
- data.tar.gz: e17c15c32b7e1ee7af521998196c9eb3e390755dbbf4d39608c2ed35b2362242c9c17abbd329262ae3d68f19db18aacfaaba66c94ca91e333c9a703ac95d2a6e
6
+ metadata.gz: b5fbb307e019c62bee59aaab8caf46cccd36876a7a257788c7e2b9df23ae3f9bedfb700240359d8409138a9b2868e301e042fd32876724c66a688f4b9ea944d0
7
+ data.tar.gz: 2ad9a28a82f81be518a72d276d5de1dc215ac1253392915e4fb6fb460d066dc6b5ddecf0026c29d64e0be98293c38b1eaeab2afe880c50672887ccf877361edf
@@ -67,9 +67,6 @@ module Libuv
67
67
  def stop_cb
68
68
  LOOPS.delete(@reactor_thread)
69
69
  @reactor_thread = nil
70
- @process_queue.close
71
- @stop_loop.close
72
- @next_tick.close
73
70
 
74
71
  ::Libuv::Ext.stop(@pointer)
75
72
  end
@@ -138,10 +138,16 @@ module Libuv
138
138
 
139
139
  def on_connect(req, status)
140
140
  ::Libuv::Ext.free(req)
141
- begin
142
- @callback.call(self)
143
- rescue Exception => e
144
- @loop.log :error, :pipe_connect_cb, e
141
+ e = check_result(status)
142
+
143
+ if e
144
+ reject(e)
145
+ else
146
+ begin
147
+ @callback.call(self)
148
+ rescue Exception => e
149
+ @loop.log :error, :pipe_connect_cb, e
150
+ end
145
151
  end
146
152
  end
147
153
 
@@ -129,10 +129,7 @@ module Libuv
129
129
 
130
130
  alias_method :do_shutdown, :shutdown
131
131
  def shutdown
132
- return if @closed
133
- if @tls.nil?
134
- do_shutdown
135
- elsif @handshake == false && @pending_writes.length > 0
132
+ if @pending_writes && @pending_writes.length > 0
136
133
  @pending_writes[-1][0].finally method(:do_shutdown)
137
134
  else
138
135
  do_shutdown
@@ -256,12 +253,18 @@ module Libuv
256
253
 
257
254
  def on_connect(req, status)
258
255
  ::Libuv::Ext.free(req)
259
- @connected = true
256
+ e = check_result(status)
260
257
 
261
- begin
262
- @callback.call(self)
263
- rescue Exception => e
264
- @loop.log :error, :connect_cb, e
258
+ if e
259
+ reject(e)
260
+ else
261
+ @connected = true
262
+
263
+ begin
264
+ @callback.call(self)
265
+ rescue Exception => e
266
+ @loop.log :error, :connect_cb, e
267
+ end
265
268
  end
266
269
  end
267
270
 
@@ -1,11 +1,5 @@
1
1
  module Libuv
2
2
  class Timer < Handle
3
- include Assertions
4
-
5
-
6
- TIMEOUT_ERROR = "timeout must be an Integer".freeze
7
- REPEAT_ERROR = "repeat must be an Integer".freeze
8
-
9
3
 
10
4
  # @param loop [::Libuv::Loop] loop this timer will be associated
11
5
  # @param callback [Proc] callback to be called when the timer is triggered
@@ -27,8 +21,8 @@ module Libuv
27
21
  return if @closed
28
22
  @stopped = false
29
23
 
30
- assert_type(Integer, timeout, TIMEOUT_ERROR)
31
- assert_type(Integer, repeat, REPEAT_ERROR)
24
+ timeout = timeout.to_i
25
+ repeat = repeat.to_i
32
26
 
33
27
  error = check_result ::Libuv::Ext.timer_start(handle, callback(:on_timer), timeout, repeat)
34
28
  reject(error) if error
@@ -52,7 +46,7 @@ module Libuv
52
46
  # Updates the repeat timeout
53
47
  def repeat=(repeat)
54
48
  return if @closed
55
- assert_type(Integer, repeat, REPEAT_ERROR)
49
+ repeat = repeat.to_i
56
50
  check_result ::Libuv::Ext.timer_set_repeat(handle, repeat)
57
51
  reject(error) if error
58
52
  end
@@ -1,3 +1,3 @@
1
1
  module Libuv
2
- VERSION = '0.11.18'
2
+ VERSION = '0.11.19'
3
3
  end
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: 0.11.18
4
+ version: 0.11.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bulat Shakirzyanov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-02 00:00:00.000000000 Z
12
+ date: 2014-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi