libuv 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -5
- data/lib/libuv/coroutines.rb +46 -0
- data/lib/libuv/ext/ext.rb +2 -0
- data/lib/libuv/loop.rb +13 -2
- data/lib/libuv/mixins/stream.rb +18 -6
- data/lib/libuv/timer.rb +4 -0
- data/lib/libuv/udp.rb +45 -25
- data/lib/libuv/version.rb +1 -1
- data/spec/coroutines_spec.rb +136 -0
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d13aec5db12ee41ad8e672bda901a128d7e29fd3
|
4
|
+
data.tar.gz: 554f2bd2a9ff1d9a69af2551a48a944e3af5cd91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8362798abe6237ea412ff7ff03fbfa27a47d3606e1f8e318ae8f33555c7e23b59e8f3c84f1ab8453b08464b69cfc1fc568a5127bcc13718f02fd5fc7cb78bf6
|
7
|
+
data.tar.gz: 7f82bc4fff20b9f0a380d3bfe76b2790b5d602679f0943cbe50835bba88a5988f09c7fab31e04d2cd43bc268e2aeec8c8cbcab626ef2a3a451c3fd2e530fbc66
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Libuv FFI bindings for Ruby
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/cotag/libuv.
|
3
|
+
[![Build Status](https://travis-ci.org/cotag/libuv.svg?branch=master)](https://travis-ci.org/cotag/libuv)
|
4
4
|
|
5
5
|
[Libuv](https://github.com/joyent/libuv) is a cross platform asynchronous IO implementation that powers NodeJS. It supports sockets, both UDP and TCP, filesystem watch, TTY, Pipes and other asynchronous primitives like timer, check, prepare and idle.
|
6
6
|
|
7
|
-
The Libuv gem contains Libuv and a Ruby wrapper that implements [pipelined promises](http://en.wikipedia.org/wiki/Futures_and_promises#Promise_pipelining) for asynchronous flow control
|
7
|
+
The Libuv gem contains Libuv and a Ruby wrapper that implements [pipelined promises](http://en.wikipedia.org/wiki/Futures_and_promises#Promise_pipelining) for asynchronous flow control and [coroutines](http://en.wikipedia.org/wiki/Coroutine) for untangling evented code
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
|
11
|
-
|
11
|
+
using promises
|
12
12
|
|
13
13
|
```ruby
|
14
14
|
require 'libuv'
|
@@ -21,7 +21,6 @@ Create a new libuv loop or use a default one
|
|
21
21
|
timer = loop.timer do
|
22
22
|
puts "5 seconds passed"
|
23
23
|
timer.close
|
24
|
-
loop.stop
|
25
24
|
end
|
26
25
|
timer.catch do |error|
|
27
26
|
puts "error with timer: #{error}"
|
@@ -33,6 +32,31 @@ Create a new libuv loop or use a default one
|
|
33
32
|
end
|
34
33
|
```
|
35
34
|
|
35
|
+
using coroutines (if a somewhat abstract example)
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
require 'libuv'
|
39
|
+
require 'libuv/coroutines'
|
40
|
+
|
41
|
+
loop = Libuv::Loop.default
|
42
|
+
loop.run do
|
43
|
+
begin
|
44
|
+
timer = loop.timer do
|
45
|
+
puts "5 seconds passed"
|
46
|
+
timer.close
|
47
|
+
end
|
48
|
+
timer.start(5000)
|
49
|
+
|
50
|
+
# co-routine waits for timer to close
|
51
|
+
co timer
|
52
|
+
|
53
|
+
puts "timer handle was closed"
|
54
|
+
rescue => error
|
55
|
+
puts "error with timer: #{error}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
36
60
|
Check out the [yard documentation](http://rubydoc.info/gems/libuv/Libuv/Loop)
|
37
61
|
|
38
62
|
|
@@ -69,7 +93,7 @@ Windows users will additionally require:
|
|
69
93
|
|
70
94
|
|
71
95
|
|
72
|
-
##
|
96
|
+
## Features
|
73
97
|
|
74
98
|
* TCP (with TLS support)
|
75
99
|
* UDP
|
@@ -87,3 +111,4 @@ Windows users will additionally require:
|
|
87
111
|
* File manipulation
|
88
112
|
* Errors (with a catch-all fallback for anything unhandled on the event loop)
|
89
113
|
* Work queue (thread pool)
|
114
|
+
* Coroutines (optional - makes use of Fibers)
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'fiber'
|
2
|
+
|
3
|
+
class ::Libuv::Loop
|
4
|
+
@@use_fibers = true
|
5
|
+
end
|
6
|
+
|
7
|
+
class Object
|
8
|
+
private
|
9
|
+
|
10
|
+
|
11
|
+
# Takes a Promise response and turns it into a co-routine
|
12
|
+
# for code execution without using callbacks
|
13
|
+
#
|
14
|
+
# @param *promises [::Libuv::Q::Promise] a number of promises that will be combined into a single promise
|
15
|
+
# @return [Object] Returns the result of a single promise or an array of results if provided multiple promises
|
16
|
+
# @raise [Exception] if the promise is rejected
|
17
|
+
def co(*yieldable, &block)
|
18
|
+
f = Fiber.current
|
19
|
+
wasError = false
|
20
|
+
|
21
|
+
# Convert the input into a promise
|
22
|
+
if yieldable.length == 1
|
23
|
+
promise = yieldable[0]
|
24
|
+
else
|
25
|
+
promise = ::Libuv::Loop.current.all(*yieldable)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Use the promise to resume the Fiber
|
29
|
+
promise.then(proc { |res|
|
30
|
+
f.resume res
|
31
|
+
}, proc { |err|
|
32
|
+
wasError = true
|
33
|
+
f.resume err
|
34
|
+
})
|
35
|
+
|
36
|
+
# Passed independently as this is often overwritten for performance
|
37
|
+
promise.progress(block) if block_given?
|
38
|
+
|
39
|
+
# Assign the result from the resume
|
40
|
+
result = Fiber.yield
|
41
|
+
|
42
|
+
# Either return the result or raise an error
|
43
|
+
raise result if wasError
|
44
|
+
result
|
45
|
+
end
|
46
|
+
end
|
data/lib/libuv/ext/ext.rb
CHANGED
@@ -91,6 +91,7 @@ module Libuv
|
|
91
91
|
attach_function :accept, :uv_accept, [:uv_stream_t, :uv_stream_t], :int, :blocking => true
|
92
92
|
attach_function :read_start, :uv_read_start, [:uv_stream_t, :uv_alloc_cb, :uv_read_cb], :int, :blocking => true
|
93
93
|
attach_function :read_stop, :uv_read_stop, [:uv_stream_t], :int, :blocking => true
|
94
|
+
attach_function :try_write, :uv_try_write, [:uv_stream_t, :pointer, :uint], :int, :blocking => true
|
94
95
|
attach_function :write, :uv_write, [:uv_write_t, :uv_stream_t, :pointer, :uint, :uv_write_cb], :int, :blocking => true
|
95
96
|
attach_function :write2, :uv_write2, [:uv_write_t, :uv_stream_t, :pointer, :uint, :uv_stream_t, :uv_write_cb], :int, :blocking => true
|
96
97
|
attach_function :is_readable, :uv_is_readable, [:uv_stream_t], :int, :blocking => true
|
@@ -116,6 +117,7 @@ module Libuv
|
|
116
117
|
attach_function :udp_set_multicast_ttl, :uv_udp_set_multicast_ttl, [:uv_udp_t, :int], :int, :blocking => true
|
117
118
|
attach_function :udp_set_broadcast, :uv_udp_set_broadcast, [:uv_udp_t, :int], :int, :blocking => true
|
118
119
|
attach_function :udp_set_ttl, :uv_udp_set_ttl, [:uv_udp_t, :int], :int, :blocking => true
|
120
|
+
attach_function :udp_try_send, :uv_udp_try_send, [:uv_udp_t, :pointer, :int, :sockaddr_in], :int, :blocking => true
|
119
121
|
attach_function :udp_send, :uv_udp_send, [:uv_udp_send_t, :uv_udp_t, :pointer, :int, :sockaddr_in, :uv_udp_send_cb], :int, :blocking => true
|
120
122
|
attach_function :udp_recv_start, :uv_udp_recv_start, [:uv_udp_t, :uv_alloc_cb, :uv_udp_recv_cb], :int, :blocking => true
|
121
123
|
attach_function :udp_recv_stop, :uv_udp_recv_stop, [:uv_udp_t], :int, :blocking => true
|
data/lib/libuv/loop.rb
CHANGED
@@ -7,6 +7,7 @@ module Libuv
|
|
7
7
|
|
8
8
|
LOOPS = ThreadSafe::Cache.new
|
9
9
|
CRITICAL = Mutex.new
|
10
|
+
@@use_fibers = false
|
10
11
|
|
11
12
|
|
12
13
|
module ClassMethods
|
@@ -122,14 +123,24 @@ module Libuv
|
|
122
123
|
begin
|
123
124
|
@reactor_thread = Thread.current
|
124
125
|
LOOPS[@reactor_thread] = @loop
|
125
|
-
|
126
|
+
if block_given?
|
127
|
+
if @@use_fibers
|
128
|
+
Fiber.new { yield @loop_notify.promise }.resume
|
129
|
+
else
|
130
|
+
yield @loop_notify.promise
|
131
|
+
end
|
132
|
+
end
|
126
133
|
::Libuv::Ext.run(@pointer, run_type) # This is blocking
|
127
134
|
ensure
|
128
135
|
@reactor_thread = nil
|
129
136
|
@run_queue.clear
|
130
137
|
end
|
131
138
|
elsif block_given?
|
132
|
-
|
139
|
+
if @@use_fibers
|
140
|
+
schedule { Fiber.new { yield @loop_notify.promise }.resume }
|
141
|
+
else
|
142
|
+
schedule { yield @loop_notify.promise }
|
143
|
+
end
|
133
144
|
end
|
134
145
|
@loop
|
135
146
|
end
|
data/lib/libuv/mixins/stream.rb
CHANGED
@@ -36,6 +36,20 @@ module Libuv
|
|
36
36
|
reject(error) if error
|
37
37
|
end
|
38
38
|
|
39
|
+
def try_write(data)
|
40
|
+
assert_type(String, data, WRITE_ERROR)
|
41
|
+
|
42
|
+
buffer1 = ::FFI::MemoryPointer.from_string(data)
|
43
|
+
buffer = ::Libuv::Ext.buf_init(buffer1, data.respond_to?(:bytesize) ? data.bytesize : data.size)
|
44
|
+
|
45
|
+
result = ::Libuv::Ext.try_write(handle, buffer, 1)
|
46
|
+
buffer1.free
|
47
|
+
|
48
|
+
error = check_result result
|
49
|
+
raise error if error
|
50
|
+
return result
|
51
|
+
end
|
52
|
+
|
39
53
|
def write(data)
|
40
54
|
# NOTE:: Similar to udp.rb -> send
|
41
55
|
deferred = @loop.defer
|
@@ -43,10 +57,8 @@ module Libuv
|
|
43
57
|
begin
|
44
58
|
assert_type(String, data, WRITE_ERROR)
|
45
59
|
|
46
|
-
|
47
|
-
|
48
|
-
buffer1.write_string data
|
49
|
-
buffer = ::Libuv::Ext.buf_init(buffer1, size)
|
60
|
+
buffer1 = ::FFI::MemoryPointer.from_string(data)
|
61
|
+
buffer = ::Libuv::Ext.buf_init(buffer1, data.respond_to?(:bytesize) ? data.bytesize : data.size)
|
50
62
|
|
51
63
|
# local as this variable will be available until the handle is closed
|
52
64
|
@write_callbacks ||= {}
|
@@ -57,7 +69,7 @@ module Libuv
|
|
57
69
|
if error
|
58
70
|
@write_callbacks.delete req.address
|
59
71
|
::Libuv::Ext.free(req)
|
60
|
-
|
72
|
+
buffer1.free
|
61
73
|
deferred.reject(error)
|
62
74
|
|
63
75
|
reject(error) # close the handle
|
@@ -112,7 +124,7 @@ module Libuv
|
|
112
124
|
deferred, buffer1 = @write_callbacks.delete req.address
|
113
125
|
|
114
126
|
::Libuv::Ext.free(req)
|
115
|
-
|
127
|
+
buffer1.free
|
116
128
|
|
117
129
|
resolve deferred, status
|
118
130
|
end
|
data/lib/libuv/timer.rb
CHANGED
@@ -21,6 +21,10 @@ module Libuv
|
|
21
21
|
return if @closed
|
22
22
|
@stopped = false
|
23
23
|
|
24
|
+
# prevent timeouts less than 0 (very long time otherwise as cast to an unsigned)
|
25
|
+
# and you probably don't want to wait a few lifetimes
|
26
|
+
timeout = 0 if timeout < 0
|
27
|
+
|
24
28
|
timeout = timeout.to_i
|
25
29
|
repeat = repeat.to_i
|
26
30
|
|
data/lib/libuv/udp.rb
CHANGED
@@ -15,6 +15,7 @@ module Libuv
|
|
15
15
|
|
16
16
|
udp_ptr = ::Libuv::Ext.create_handle(:uv_udp)
|
17
17
|
error = check_result(::Libuv::Ext.udp_init(loop.handle, udp_ptr))
|
18
|
+
@request_refs = {}
|
18
19
|
|
19
20
|
super(udp_ptr, error)
|
20
21
|
end
|
@@ -39,7 +40,7 @@ module Libuv
|
|
39
40
|
return [] if @closed
|
40
41
|
sockaddr, len = get_sockaddr_and_len
|
41
42
|
check_result! ::Libuv::Ext.udp_getsockname(handle, sockaddr, len)
|
42
|
-
get_ip_and_port(
|
43
|
+
get_ip_and_port(::Libuv::Ext::Sockaddr.new(sockaddr), len.get_int(0))
|
43
44
|
end
|
44
45
|
|
45
46
|
def join(multicast_address, interface_address)
|
@@ -76,6 +77,29 @@ module Libuv
|
|
76
77
|
reject(error) if error
|
77
78
|
end
|
78
79
|
|
80
|
+
def try_send(ip, port, data)
|
81
|
+
assert_type(String, ip, IP_ARGUMENT_ERROR)
|
82
|
+
assert_type(Integer, port, PORT_ARGUMENT_ERROR)
|
83
|
+
assert_type(String, data, SEND_DATA_ERROR)
|
84
|
+
|
85
|
+
sockaddr = create_sockaddr(ip, port)
|
86
|
+
|
87
|
+
buffer1 = ::FFI::MemoryPointer.from_string(data)
|
88
|
+
buffer = ::Libuv::Ext.buf_init(buffer1, data.respond_to?(:bytesize) ? data.bytesize : data.size)
|
89
|
+
|
90
|
+
result = ::Libuv::Ext.udp_try_send(
|
91
|
+
handle,
|
92
|
+
buffer,
|
93
|
+
1,
|
94
|
+
sockaddr
|
95
|
+
)
|
96
|
+
buffer1.free
|
97
|
+
|
98
|
+
error = check_result result
|
99
|
+
raise error if error
|
100
|
+
return result
|
101
|
+
end
|
102
|
+
|
79
103
|
def send(ip, port, data)
|
80
104
|
# NOTE:: Similar to stream.rb -> write
|
81
105
|
deferred = @loop.defer
|
@@ -87,34 +111,25 @@ module Libuv
|
|
87
111
|
|
88
112
|
sockaddr = create_sockaddr(ip, port)
|
89
113
|
|
90
|
-
#
|
91
|
-
|
114
|
+
# Save a reference to this request
|
115
|
+
req = send_req
|
116
|
+
buffer1 = ::FFI::MemoryPointer.from_string(data)
|
117
|
+
buffer = ::Libuv::Ext.buf_init(buffer1, data.respond_to?(:bytesize) ? data.bytesize : data.size)
|
118
|
+
@request_refs[req.address] = [deferred, buffer1]
|
92
119
|
|
93
|
-
#
|
94
|
-
# create the curried callback
|
95
|
-
#
|
96
|
-
callback = FFI::Function.new(:void, [:pointer, :int]) do |req, status|
|
97
|
-
::Libuv::Ext.free(req)
|
98
|
-
# remove the callback from the array
|
99
|
-
# assumes sends are done in order
|
100
|
-
promise = @sent_callbacks.shift[0]
|
101
|
-
resolve promise, status
|
102
|
-
end
|
103
|
-
|
104
|
-
#
|
105
120
|
# Save the callback and return the promise
|
106
|
-
#
|
107
|
-
@sent_callbacks << [deferred, callback]
|
108
121
|
error = check_result ::Libuv::Ext.udp_send(
|
109
|
-
|
122
|
+
req,
|
110
123
|
handle,
|
111
|
-
|
124
|
+
buffer,
|
112
125
|
1,
|
113
126
|
sockaddr,
|
114
|
-
callback
|
127
|
+
callback(:send_complete)
|
115
128
|
)
|
116
129
|
if error
|
117
|
-
@
|
130
|
+
@request_refs.delete req.address
|
131
|
+
::Libuv::Ext.free(req)
|
132
|
+
buffer1.free
|
118
133
|
deferred.reject(error)
|
119
134
|
reject(error) # close the handle
|
120
135
|
end
|
@@ -177,10 +192,6 @@ module Libuv
|
|
177
192
|
::Libuv::Ext.create_request(:uv_udp_send)
|
178
193
|
end
|
179
194
|
|
180
|
-
def buf_init(data)
|
181
|
-
::Libuv::Ext.buf_init(FFI::MemoryPointer.from_string(data), data.respond_to?(:bytesize) ? data.bytesize : data.size)
|
182
|
-
end
|
183
|
-
|
184
195
|
def create_sockaddr(ip, port)
|
185
196
|
ips = IPAddr.new(ip)
|
186
197
|
if ips.ipv4?
|
@@ -237,5 +248,14 @@ module Libuv
|
|
237
248
|
@receive_size = nil
|
238
249
|
end
|
239
250
|
end
|
251
|
+
|
252
|
+
def send_complete(req, status)
|
253
|
+
deferred, buffer1 = @request_refs.delete req.address
|
254
|
+
|
255
|
+
::Libuv::Ext.free(req)
|
256
|
+
buffer1.free
|
257
|
+
|
258
|
+
resolve deferred, status
|
259
|
+
end
|
240
260
|
end
|
241
261
|
end
|
data/lib/libuv/version.rb
CHANGED
@@ -0,0 +1,136 @@
|
|
1
|
+
require 'libuv'
|
2
|
+
require 'libuv/coroutines' # adds support for coroutines
|
3
|
+
|
4
|
+
|
5
|
+
describe Object do
|
6
|
+
before :each do
|
7
|
+
@log = []
|
8
|
+
@general_failure = []
|
9
|
+
|
10
|
+
@loop = Libuv::Loop.default
|
11
|
+
@timeout = @loop.timer do
|
12
|
+
@timeout.close
|
13
|
+
@loop.stop
|
14
|
+
@general_failure << "test timed out"
|
15
|
+
end
|
16
|
+
@timeout.start(5000)
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'serial execution' do
|
20
|
+
it "should wait for work to complete and return the result" do
|
21
|
+
@loop.run { |logger|
|
22
|
+
logger.progress do |level, errorid, error|
|
23
|
+
begin
|
24
|
+
@general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
|
25
|
+
rescue Exception => e
|
26
|
+
@general_failure << "error in logger #{e.inspect}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
@log << co(@loop.work(proc {
|
32
|
+
sleep 1
|
33
|
+
'work done'
|
34
|
+
}))
|
35
|
+
@log << 'after work'
|
36
|
+
|
37
|
+
@timeout.close
|
38
|
+
@loop.stop
|
39
|
+
}
|
40
|
+
|
41
|
+
expect(@general_failure).to eq([])
|
42
|
+
expect(@log).to eq(['work done', 'after work'])
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should raise an error if the promise is rejected" do
|
46
|
+
@loop.run { |logger|
|
47
|
+
logger.progress do |level, errorid, error|
|
48
|
+
begin
|
49
|
+
@general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
|
50
|
+
rescue Exception => e
|
51
|
+
@general_failure << "error in logger #{e.inspect}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
begin
|
56
|
+
@log << co(@loop.work(proc {
|
57
|
+
raise 'rejected'
|
58
|
+
}))
|
59
|
+
@log << 'after work'
|
60
|
+
rescue => e
|
61
|
+
@log << e.message
|
62
|
+
end
|
63
|
+
|
64
|
+
@timeout.close
|
65
|
+
@loop.stop
|
66
|
+
}
|
67
|
+
|
68
|
+
expect(@general_failure).to eq([])
|
69
|
+
expect(@log).to eq(['rejected'])
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should return the results of multiple promises" do
|
73
|
+
@loop.run { |logger|
|
74
|
+
logger.progress do |level, errorid, error|
|
75
|
+
begin
|
76
|
+
@general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
|
77
|
+
rescue Exception => e
|
78
|
+
@general_failure << "error in logger #{e.inspect}"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
job1 = @loop.work(proc {
|
84
|
+
sleep 1
|
85
|
+
'job1'
|
86
|
+
})
|
87
|
+
|
88
|
+
job2 = @loop.work(proc {
|
89
|
+
sleep 1
|
90
|
+
'job2'
|
91
|
+
})
|
92
|
+
|
93
|
+
# Job1 and Job2 are executed in parallel
|
94
|
+
result1, result2 = co(job1, job2)
|
95
|
+
|
96
|
+
@log << result1
|
97
|
+
@log << result2
|
98
|
+
@log << 'after work'
|
99
|
+
|
100
|
+
@timeout.close
|
101
|
+
@loop.stop
|
102
|
+
}
|
103
|
+
|
104
|
+
expect(@general_failure).to eq([])
|
105
|
+
expect(@log).to eq(['job1', 'job2', 'after work'])
|
106
|
+
end
|
107
|
+
|
108
|
+
|
109
|
+
it "should provide a callback option for progress events" do
|
110
|
+
@loop.run { |logger|
|
111
|
+
logger.progress do |level, errorid, error|
|
112
|
+
begin
|
113
|
+
@general_failure << "Log called: #{level}: #{errorid}\n#{error.message}\n#{error.backtrace.join("\n") if error.backtrace}\n"
|
114
|
+
rescue Exception => e
|
115
|
+
@general_failure << "error in logger #{e.inspect}"
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
timer = @loop.timer
|
120
|
+
timer.start(0)
|
121
|
+
co(timer) do
|
122
|
+
@log << 'in timer'
|
123
|
+
timer.close # close will resolve the promise
|
124
|
+
end
|
125
|
+
|
126
|
+
@log << 'after timer'
|
127
|
+
|
128
|
+
@timeout.close
|
129
|
+
@loop.stop
|
130
|
+
}
|
131
|
+
|
132
|
+
expect(@log).to eq(['in timer', 'after timer'])
|
133
|
+
expect(@general_failure).to eq([])
|
134
|
+
end
|
135
|
+
end
|
136
|
+
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: 1.0.
|
4
|
+
version: 1.0.2
|
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-
|
12
|
+
date: 2014-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/libuv.rb
|
118
118
|
- lib/libuv/async.rb
|
119
119
|
- lib/libuv/check.rb
|
120
|
+
- lib/libuv/coroutines.rb
|
120
121
|
- lib/libuv/dns.rb
|
121
122
|
- lib/libuv/error.rb
|
122
123
|
- lib/libuv/ext/ext.rb
|
@@ -153,6 +154,7 @@ files:
|
|
153
154
|
- lib/libuv/work.rb
|
154
155
|
- libuv.gemspec
|
155
156
|
- spec/async_spec.rb
|
157
|
+
- spec/coroutines_spec.rb
|
156
158
|
- spec/cpu_spec.rb
|
157
159
|
- spec/defer_spec.rb
|
158
160
|
- spec/dns_spec.rb
|
@@ -175,15 +177,19 @@ files:
|
|
175
177
|
- ext/libuv/common.gypi
|
176
178
|
- ext/libuv/configure.ac
|
177
179
|
- ext/libuv/gyp_uv.py
|
180
|
+
- ext/libuv/img/banner.png
|
181
|
+
- ext/libuv/img/logos.svg
|
178
182
|
- ext/libuv/include/android-ifaddrs.h
|
179
183
|
- ext/libuv/include/pthread-fixes.h
|
180
184
|
- ext/libuv/include/stdint-msvc2008.h
|
181
185
|
- ext/libuv/include/tree.h
|
186
|
+
- ext/libuv/include/uv-aix.h
|
182
187
|
- ext/libuv/include/uv-bsd.h
|
183
188
|
- ext/libuv/include/uv-darwin.h
|
184
189
|
- ext/libuv/include/uv-errno.h
|
185
190
|
- ext/libuv/include/uv-linux.h
|
186
191
|
- ext/libuv/include/uv-sunos.h
|
192
|
+
- ext/libuv/include/uv-threadpool.h
|
187
193
|
- ext/libuv/include/uv-unix.h
|
188
194
|
- ext/libuv/include/uv-version.h
|
189
195
|
- ext/libuv/include/uv-win.h
|
@@ -209,6 +215,7 @@ files:
|
|
209
215
|
- ext/libuv/src/heap-inl.h
|
210
216
|
- ext/libuv/src/inet.c
|
211
217
|
- ext/libuv/src/queue.h
|
218
|
+
- ext/libuv/src/threadpool.c
|
212
219
|
- ext/libuv/src/unix/aix.c
|
213
220
|
- ext/libuv/src/unix/android-ifaddrs.c
|
214
221
|
- ext/libuv/src/unix/async.c
|
@@ -221,6 +228,7 @@ files:
|
|
221
228
|
- ext/libuv/src/unix/fs.c
|
222
229
|
- ext/libuv/src/unix/fsevents.c
|
223
230
|
- ext/libuv/src/unix/getaddrinfo.c
|
231
|
+
- ext/libuv/src/unix/getnameinfo.c
|
224
232
|
- ext/libuv/src/unix/internal.h
|
225
233
|
- ext/libuv/src/unix/kqueue.c
|
226
234
|
- ext/libuv/src/unix/linux-core.c
|
@@ -242,7 +250,6 @@ files:
|
|
242
250
|
- ext/libuv/src/unix/sunos.c
|
243
251
|
- ext/libuv/src/unix/tcp.c
|
244
252
|
- ext/libuv/src/unix/thread.c
|
245
|
-
- ext/libuv/src/unix/threadpool.c
|
246
253
|
- ext/libuv/src/unix/timer.c
|
247
254
|
- ext/libuv/src/unix/tty.c
|
248
255
|
- ext/libuv/src/unix/udp.c
|
@@ -258,6 +265,7 @@ files:
|
|
258
265
|
- ext/libuv/src/win/fs-event.c
|
259
266
|
- ext/libuv/src/win/fs.c
|
260
267
|
- ext/libuv/src/win/getaddrinfo.c
|
268
|
+
- ext/libuv/src/win/getnameinfo.c
|
261
269
|
- ext/libuv/src/win/handle-inl.h
|
262
270
|
- ext/libuv/src/win/handle.c
|
263
271
|
- ext/libuv/src/win/internal.h
|
@@ -273,7 +281,6 @@ files:
|
|
273
281
|
- ext/libuv/src/win/stream.c
|
274
282
|
- ext/libuv/src/win/tcp.c
|
275
283
|
- ext/libuv/src/win/thread.c
|
276
|
-
- ext/libuv/src/win/threadpool.c
|
277
284
|
- ext/libuv/src/win/timer.c
|
278
285
|
- ext/libuv/src/win/tty.c
|
279
286
|
- ext/libuv/src/win/udp.c
|
@@ -337,6 +344,7 @@ files:
|
|
337
344
|
- ext/libuv/test/test-get-loadavg.c
|
338
345
|
- ext/libuv/test/test-get-memory.c
|
339
346
|
- ext/libuv/test/test-getaddrinfo.c
|
347
|
+
- ext/libuv/test/test-getnameinfo.c
|
340
348
|
- ext/libuv/test/test-getsockname.c
|
341
349
|
- ext/libuv/test/test-hrtime.c
|
342
350
|
- ext/libuv/test/test-idle.c
|
@@ -362,6 +370,7 @@ files:
|
|
362
370
|
- ext/libuv/test/test-pipe-server-close.c
|
363
371
|
- ext/libuv/test/test-platform-output.c
|
364
372
|
- ext/libuv/test/test-poll-close.c
|
373
|
+
- ext/libuv/test/test-poll-closesocket.c
|
365
374
|
- ext/libuv/test/test-poll.c
|
366
375
|
- ext/libuv/test/test-process-title.c
|
367
376
|
- ext/libuv/test/test-ref.c
|
@@ -390,6 +399,7 @@ files:
|
|
390
399
|
- ext/libuv/test/test-tcp-shutdown-after-write.c
|
391
400
|
- ext/libuv/test/test-tcp-try-write.c
|
392
401
|
- ext/libuv/test/test-tcp-unexpected-read.c
|
402
|
+
- ext/libuv/test/test-tcp-write-queue-order.c
|
393
403
|
- ext/libuv/test/test-tcp-write-to-half-open-connection.c
|
394
404
|
- ext/libuv/test/test-tcp-writealot.c
|
395
405
|
- ext/libuv/test/test-thread.c
|
@@ -410,6 +420,8 @@ files:
|
|
410
420
|
- ext/libuv/test/test-udp-open.c
|
411
421
|
- ext/libuv/test/test-udp-options.c
|
412
422
|
- ext/libuv/test/test-udp-send-and-recv.c
|
423
|
+
- ext/libuv/test/test-udp-send-immediate.c
|
424
|
+
- ext/libuv/test/test-udp-try-send.c
|
413
425
|
- ext/libuv/test/test-walk-handles.c
|
414
426
|
- ext/libuv/test/test-watcher-cross-stop.c
|
415
427
|
- ext/libuv/uv.gyp
|
@@ -440,6 +452,7 @@ specification_version: 4
|
|
440
452
|
summary: libuv bindings for Ruby
|
441
453
|
test_files:
|
442
454
|
- spec/async_spec.rb
|
455
|
+
- spec/coroutines_spec.rb
|
443
456
|
- spec/cpu_spec.rb
|
444
457
|
- spec/defer_spec.rb
|
445
458
|
- spec/dns_spec.rb
|