async-websocket 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -21
- data/async-websocket.gemspec +1 -1
- data/examples/chat/client.rb +1 -1
- data/examples/chat/config.ru +2 -2
- data/examples/chat/multi-client.rb +2 -2
- data/lib/async/websocket/adapters/rack.rb +1 -0
- data/lib/async/websocket/client.rb +3 -1
- data/lib/async/websocket/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59123bc7ccf2af0d260325c7aa1c334069e8f39033e7f4816d026c03b9ff30d3
|
4
|
+
data.tar.gz: f88b770e168497e9331bfd9eaa47ff3ba0247f4f9d1ef326e7f90f798330e5c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4e9e0c695517a81251fc5fafb56a03fcf9b26338b2942131b002a34731178ee4f9249c4ca89b652308c8dd7baf7cf6ec9bd0b299fc48df09004695413813ed0
|
7
|
+
data.tar.gz: dc18bbb860db8cda14bc863211ead3c64276086c297632beca706dc142e10005a7c4a75e6e8876c3d0781dacd149be1a020530e6759a6caceb91b492ca816490
|
data/.gitignore
CHANGED
@@ -1,22 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec_status
|
6
12
|
Gemfile.lock
|
7
|
-
|
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
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
13
|
+
.covered.db
|
data/async-websocket.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
spec.add_dependency "async-io", "~> 1.23"
|
19
19
|
spec.add_dependency "async-http", "~> 0.41"
|
20
|
-
spec.add_dependency "protocol-websocket", "~> 0.
|
20
|
+
spec.add_dependency "protocol-websocket", "~> 0.6.0"
|
21
21
|
|
22
22
|
spec.add_development_dependency "async-rspec"
|
23
23
|
spec.add_development_dependency "falcon", "~> 0.30"
|
data/examples/chat/client.rb
CHANGED
@@ -14,7 +14,7 @@ Async do |task|
|
|
14
14
|
Async::IO::Generic.new($stdin)
|
15
15
|
)
|
16
16
|
|
17
|
-
Async::WebSocket::Client.
|
17
|
+
Async::WebSocket::Client.connect(ENDPOINT) do |connection|
|
18
18
|
input_task = task.async do
|
19
19
|
while line = stdin.read_until("\n")
|
20
20
|
connection.write({text: line})
|
data/examples/chat/config.ru
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env -S falcon serve --bind http://127.0.0.1:8080 --count 1 -c
|
2
2
|
|
3
|
-
require_relative '../../lib/async/websocket/
|
3
|
+
require_relative '../../lib/async/websocket/adapters/rack'
|
4
4
|
require 'async/clock'
|
5
5
|
require 'async/semaphore'
|
6
6
|
require 'async/logger'
|
@@ -106,7 +106,7 @@ class Room
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def call(env)
|
109
|
-
Async::WebSocket::
|
109
|
+
Async::WebSocket::Adapters::Rack.open(env, &self.method(:open))
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
@@ -58,10 +58,10 @@ class Command < Samovar::Command
|
|
58
58
|
# subtask.children.each(&:stop)
|
59
59
|
end
|
60
60
|
|
61
|
-
client = Async::WebSocket::Client.
|
61
|
+
client = Async::WebSocket::Client.open(endpoint)
|
62
62
|
|
63
63
|
count.times do |i|
|
64
|
-
connections.enqueue(client.
|
64
|
+
connections.enqueue(client.connect(endpoint.path))
|
65
65
|
progress.advance(1)
|
66
66
|
end
|
67
67
|
|
@@ -21,11 +21,13 @@
|
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
23
|
require_relative 'request'
|
24
|
+
require_relative 'connection'
|
24
25
|
|
25
26
|
require 'protocol/websocket/headers'
|
26
|
-
|
27
27
|
require 'protocol/http/middleware'
|
28
28
|
|
29
|
+
require 'async/http/client'
|
30
|
+
|
29
31
|
module Async
|
30
32
|
module WebSocket
|
31
33
|
# This is a basic synchronous websocket client:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.6.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.6.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: async-rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|