ld-celluloid-eventsource 0.8.0 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Contributing.md +8 -0
- data/ld-celluloid-eventsource.gemspec +3 -2
- data/lib/{ld_celluloid_eventsource → celluloid/eventsource}/response_parser.rb +0 -0
- data/lib/{ld_celluloid_eventsource → celluloid/eventsource}/version.rb +1 -1
- data/lib/{ld_celluloid_eventsource → celluloid}/eventsource.rb +6 -2
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 288de259557b7071ab952b7df40df3e2b8587f19
|
4
|
+
data.tar.gz: 3edd6ecf59ea11f86e6566694097803fe74b70bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a01ad04de73834ccf18831b1acb5d784de31e2101c995082004e3c41b901adecbb31eef9f0a234059fae879093007aa76b67a3e1b313e508b4b366add12b5d
|
7
|
+
data.tar.gz: 039ddf8432791cefed4e82e6b60457fc984277373f42c284747acf62633b15a3f493b4b8c9ff6f9499de62fbe5496f1bfa14ce80ae94d70dfc90079b212077ec
|
data/Contributing.md
ADDED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'celluloid/eventsource/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "ld-celluloid-eventsource"
|
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency 'celluloid-io', '~> 0.17.3'
|
22
|
+
spec.add_dependency 'nio4r', '~> 1.1'
|
22
23
|
spec.add_dependency 'http_parser.rb', '~> 0.6.0'
|
23
|
-
spec.add_dependency 'concurrent-ruby', '~> 1.0
|
24
|
+
spec.add_dependency 'concurrent-ruby', '~> 1.0'
|
24
25
|
spec.add_dependency 'retries', '~> 0.0.5'
|
25
26
|
|
26
27
|
spec.add_development_dependency "rspec", '~> 3.0'
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'celluloid/current'
|
2
|
-
require
|
2
|
+
require 'celluloid/eventsource/version'
|
3
3
|
require 'celluloid/io'
|
4
4
|
require 'celluloid/eventsource/response_parser'
|
5
5
|
require 'concurrent'
|
@@ -41,7 +41,7 @@ module Celluloid
|
|
41
41
|
@last_event_id = String.new
|
42
42
|
|
43
43
|
@reconnect_timeout = 1
|
44
|
-
@on = { open: ->{}, message: ->(_) {}}
|
44
|
+
@on = { open: ->{}, message: ->(_) {}, error: ->(_) {}}
|
45
45
|
@parser = ResponseParser.new
|
46
46
|
|
47
47
|
@chunked = false
|
@@ -103,6 +103,10 @@ module Celluloid
|
|
103
103
|
@on[:message] = action
|
104
104
|
end
|
105
105
|
|
106
|
+
def on_error(&action)
|
107
|
+
@on[:error] = action
|
108
|
+
end
|
109
|
+
|
106
110
|
private
|
107
111
|
|
108
112
|
MessageEvent = Struct.new(:type, :data, :last_event_id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ld-celluloid-eventsource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leo Correa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid-io
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.17.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nio4r
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: http_parser.rb
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +58,14 @@ dependencies:
|
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0
|
61
|
+
version: '1.0'
|
48
62
|
type: :runtime
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0
|
68
|
+
version: '1.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: retries
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,14 +147,15 @@ files:
|
|
133
147
|
- ".gitignore"
|
134
148
|
- ".rspec"
|
135
149
|
- ".travis.yml"
|
150
|
+
- Contributing.md
|
136
151
|
- Gemfile
|
137
152
|
- LICENSE
|
138
153
|
- README.md
|
139
154
|
- Rakefile
|
140
155
|
- ld-celluloid-eventsource.gemspec
|
141
|
-
- lib/
|
142
|
-
- lib/
|
143
|
-
- lib/
|
156
|
+
- lib/celluloid/eventsource.rb
|
157
|
+
- lib/celluloid/eventsource/response_parser.rb
|
158
|
+
- lib/celluloid/eventsource/version.rb
|
144
159
|
- log/.gitignore
|
145
160
|
- spec/celluloid/eventsource/response_parser_spec.rb
|
146
161
|
- spec/celluloid/eventsource_spec.rb
|