anycable 0.6.0.rc1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/anycable.rb +10 -0
- data/lib/anycable/cli.rb +6 -0
- data/lib/anycable/server.rb +2 -0
- data/lib/anycable/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9ae04f9598f3eff108b5370c1d173154bdab5d7e025a088a5b72375dc316db6
|
4
|
+
data.tar.gz: 932eef1358398dd50d0347f7c16eadae2c3edd1ce431807c115dc3eed7480d5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a118f66c08b3555e5627973160d9f0c09c1796fb6f4f9b7157ed39be8f67cfdf735109d31b8e510b3ef4b6fa94427b9d178e37fb55edc416255763e190e99d
|
7
|
+
data.tar.gz: 8df3faa61cbb9f6f36ca1f009842e5f14a1d68e775e2c670b952c61b20c564aad66807bd3c71f61e1895aa17953d365be90e2ca446fa275389c7ec8ad8d0f296
|
data/CHANGELOG.md
CHANGED
@@ -77,6 +77,10 @@ See [docs](https://docs.anycable.io/#/./middlewares).
|
|
77
77
|
|
78
78
|
See [docs](https://docs.anycable.io/#/./health_checking).
|
79
79
|
|
80
|
+
- Added hook to run code only within RPC server context.
|
81
|
+
|
82
|
+
Use `AnyCable.configure_server { ... }` to run code only when RPC server is running.
|
83
|
+
|
80
84
|
### API changes
|
81
85
|
|
82
86
|
**NOTE**: the old API is still working but deprecated (you'll see a notice).
|
data/lib/anycable.rb
CHANGED
@@ -60,6 +60,16 @@ module AnyCable
|
|
60
60
|
ExceptionsHandling
|
61
61
|
end
|
62
62
|
|
63
|
+
# Register a callback to be invoked before
|
64
|
+
# the server starts
|
65
|
+
def configure_server(&block)
|
66
|
+
server_callbacks << block
|
67
|
+
end
|
68
|
+
|
69
|
+
def server_callbacks
|
70
|
+
@server_callbacks ||= []
|
71
|
+
end
|
72
|
+
|
63
73
|
def broadcast_adapter
|
64
74
|
self.broadcast_adapter = :redis unless instance_variable_defined?(:@broadcast_adapter)
|
65
75
|
@broadcast_adapter
|
data/lib/anycable/cli.rb
CHANGED
@@ -40,6 +40,8 @@ module AnyCable
|
|
40
40
|
|
41
41
|
logger.info "Serving #{defined?(::Rails) ? 'Rails ' : ''}application from #{boot_file}"
|
42
42
|
|
43
|
+
configure_server!
|
44
|
+
|
43
45
|
verify_connection_factory!
|
44
46
|
|
45
47
|
log_grpc! if config.log_grpc
|
@@ -156,6 +158,10 @@ module AnyCable
|
|
156
158
|
APP_CANDIDATES.detect { |path| File.exist?(path) }
|
157
159
|
end
|
158
160
|
|
161
|
+
def configure_server!
|
162
|
+
AnyCable.server_callbacks.each(&:call)
|
163
|
+
end
|
164
|
+
|
159
165
|
def start_health_server!
|
160
166
|
@health_server = AnyCable::HealthServer.new(
|
161
167
|
server,
|
data/lib/anycable/server.rb
CHANGED
data/lib/anycable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.0
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|
@@ -244,9 +244,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: 2.4.0
|
245
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
246
|
requirements:
|
247
|
-
- - "
|
247
|
+
- - ">="
|
248
248
|
- !ruby/object:Gem::Version
|
249
|
-
version:
|
249
|
+
version: '0'
|
250
250
|
requirements: []
|
251
251
|
rubyforge_project:
|
252
252
|
rubygems_version: 2.7.7
|