libuv 3.1.4 → 3.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -0
- data/lib/libuv.rb +1 -1
- data/lib/libuv/mixins/listener.rb +1 -1
- data/lib/libuv/reactor.rb +1 -1
- data/lib/libuv/timer.rb +4 -4
- data/lib/libuv/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391622587a3befa99bdc244c56eb092b39360cb0
|
4
|
+
data.tar.gz: 96777561f318363f1d1c013670f7d2689a456b31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff2c5f431f2eca50f6cc0d9d70bb04be8031a407c8682de5bd7c70817cb1de67bb5d553b8767843591051e2347f156c89e69d02e3d5acce7b027f40f750af95c
|
7
|
+
data.tar.gz: 56148dc4f54682631778d14d74b894d8c93957862f500041842d6f6000b43cf3ab155a1302d214f5d3de63d56272fd4a85651ffdebaeb48c94e7e97a0cbccbd0
|
data/README.md
CHANGED
@@ -143,3 +143,38 @@ Windows users will additionally require:
|
|
143
143
|
* Errors (with a catch-all fallback for anything unhandled on the event reactor)
|
144
144
|
* Work queue (thread pool)
|
145
145
|
* Coroutines / futures (makes use of Fibers)
|
146
|
+
|
147
|
+
### Server Name Indication
|
148
|
+
|
149
|
+
You can host a TLS enabled server with multiple hostnames using SNI.
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
server = reactor.tcp
|
153
|
+
server.bind('0.0.0.0', 3000, **{
|
154
|
+
hosts: [{
|
155
|
+
private_key: '/blah.key',
|
156
|
+
cert_chain: '/blah.crt',
|
157
|
+
host_name: 'somehost.com',
|
158
|
+
},
|
159
|
+
{
|
160
|
+
private_key: '/blah2.key',
|
161
|
+
cert_chain: '/blah2.crt',
|
162
|
+
host_name: 'somehost2.com'
|
163
|
+
},
|
164
|
+
{
|
165
|
+
private_key: '/blah3.key',
|
166
|
+
cert_chain: '/blah3.crt',
|
167
|
+
host_name: 'somehost3.com'
|
168
|
+
}]
|
169
|
+
}) do |client|
|
170
|
+
client.start_tls
|
171
|
+
client.start_read
|
172
|
+
end
|
173
|
+
|
174
|
+
# at some point later
|
175
|
+
server.add_host(private_key: '/blah4.key', cert_chain: '/blah4.crt', host_name: 'somehost4.com')
|
176
|
+
server.remove_host('somehost2.com')
|
177
|
+
```
|
178
|
+
|
179
|
+
You don't have to specify any hosts at binding time.
|
180
|
+
|
data/lib/libuv.rb
CHANGED
@@ -47,7 +47,7 @@ module Libuv
|
|
47
47
|
|
48
48
|
# Returns the number of CPU cores on the host platform
|
49
49
|
#
|
50
|
-
# @return [
|
50
|
+
# @return [Integer, nil] representing the number of CPU cores or nil if failed
|
51
51
|
def self.cpu_count
|
52
52
|
cpu_info = FFI::MemoryPointer.new(:pointer)
|
53
53
|
cpu_count = FFI::MemoryPointer.new(:int)
|
@@ -43,7 +43,7 @@ module Libuv
|
|
43
43
|
|
44
44
|
def self.included(base)
|
45
45
|
base.instance_variable_set(:@callback_funcs, {})
|
46
|
-
base.instance_variable_set(:@callback_lookup, ::Concurrent::
|
46
|
+
base.instance_variable_set(:@callback_lookup, ::Concurrent::Hash.new)
|
47
47
|
base.instance_variable_set(:@callback_lock, ::Mutex.new)
|
48
48
|
base.extend(ClassMethods)
|
49
49
|
end
|
data/lib/libuv/reactor.rb
CHANGED
data/lib/libuv/timer.rb
CHANGED
@@ -22,8 +22,8 @@ module Libuv
|
|
22
22
|
|
23
23
|
# Enables the timer. A repeat of 0 means no repeat
|
24
24
|
#
|
25
|
-
# @param timeout [Integer
|
26
|
-
# @param repeat [Integer
|
25
|
+
# @param timeout [Integer] time in milliseconds before the timer callback is triggered the first time
|
26
|
+
# @param repeat [Integer] time in milliseconds between repeated callbacks after the first
|
27
27
|
def start(timeout, repeat = 0)
|
28
28
|
return if @closed
|
29
29
|
@stopped = false
|
@@ -61,7 +61,7 @@ module Libuv
|
|
61
61
|
# Set the current repeat timeout
|
62
62
|
# Repeat is the time in milliseconds between repeated callbacks after the initial timeout fires
|
63
63
|
#
|
64
|
-
# @param time [Integer
|
64
|
+
# @param time [Integer] time in milliseconds between repeated callbacks after the first
|
65
65
|
def repeat=(time)
|
66
66
|
return if @closed
|
67
67
|
error = check_result ::Libuv::Ext.timer_set_repeat(handle, time.to_i)
|
@@ -72,7 +72,7 @@ module Libuv
|
|
72
72
|
# Set or gets the current repeat timeout
|
73
73
|
# Repeat is the time in milliseconds between repeated callbacks after the initial timeout fires
|
74
74
|
#
|
75
|
-
# @param times [Integer
|
75
|
+
# @param times [Integer] time in milliseconds between repeated callbacks after the first
|
76
76
|
def repeat(time = nil)
|
77
77
|
return if @closed
|
78
78
|
if time.nil?
|
data/lib/libuv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libuv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -221,6 +221,7 @@ files:
|
|
221
221
|
- ext/libuv/src/unix/android-ifaddrs.c
|
222
222
|
- ext/libuv/src/unix/async.c
|
223
223
|
- ext/libuv/src/unix/atomic-ops.h
|
224
|
+
- ext/libuv/src/unix/bsd-ifaddrs.c
|
224
225
|
- ext/libuv/src/unix/core.c
|
225
226
|
- ext/libuv/src/unix/darwin-proctitle.c
|
226
227
|
- ext/libuv/src/unix/darwin.c
|
@@ -245,6 +246,7 @@ files:
|
|
245
246
|
- ext/libuv/src/unix/os390.c
|
246
247
|
- ext/libuv/src/unix/pipe.c
|
247
248
|
- ext/libuv/src/unix/poll.c
|
249
|
+
- ext/libuv/src/unix/posix-hrtime.c
|
248
250
|
- ext/libuv/src/unix/process.c
|
249
251
|
- ext/libuv/src/unix/proctitle.c
|
250
252
|
- ext/libuv/src/unix/pthread-barrier.c
|
@@ -343,8 +345,10 @@ files:
|
|
343
345
|
- ext/libuv/test/test-eintr-handling.c
|
344
346
|
- ext/libuv/test/test-embed.c
|
345
347
|
- ext/libuv/test/test-emfile.c
|
348
|
+
- ext/libuv/test/test-env-vars.c
|
346
349
|
- ext/libuv/test/test-error.c
|
347
350
|
- ext/libuv/test/test-fail-always.c
|
351
|
+
- ext/libuv/test/test-fork.c
|
348
352
|
- ext/libuv/test/test-fs-event.c
|
349
353
|
- ext/libuv/test/test-fs-poll.c
|
350
354
|
- ext/libuv/test/test-fs.c
|
@@ -454,6 +458,7 @@ files:
|
|
454
458
|
- ext/libuv/test/test-udp-try-send.c
|
455
459
|
- ext/libuv/test/test-walk-handles.c
|
456
460
|
- ext/libuv/test/test-watcher-cross-stop.c
|
461
|
+
- ext/libuv/tools/make_dist_html.py
|
457
462
|
- ext/libuv/uv.gyp
|
458
463
|
- ext/libuv/vcbuild.bat
|
459
464
|
- lib/libuv.rb
|
@@ -528,7 +533,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
528
533
|
version: '0'
|
529
534
|
requirements: []
|
530
535
|
rubyforge_project:
|
531
|
-
rubygems_version: 2.
|
536
|
+
rubygems_version: 2.6.10
|
532
537
|
signing_key:
|
533
538
|
specification_version: 4
|
534
539
|
summary: libuv bindings for Ruby
|