orbitcast 0.3.1-x86_64-linux-gnu → 0.3.3-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77755534870e43df67c1865573535b300c890a83f83aa1ebe146fd3b5b7dc917
4
- data.tar.gz: 650a4513419e86681323b2c34aeef2b7110d9a9506af80c1014d7b094757664c
3
+ metadata.gz: e2566206c2a56bb4b675896ca927b883174d1c1d9dd2b64d4b6aa7dd8bb4428e
4
+ data.tar.gz: 1bda64be595fc518d36102b24e5c7748172ea9d95ca7d0f78d50e22e2f84925a
5
5
  SHA512:
6
- metadata.gz: bd6c59891c305cad7f2df1e6358b4f3211ff1ce22381e48bf924d7c5d9762f0f2a79626a5ff1f2358a0b4bbab68f177b8a34ac94540772879ada1f83169a0c0f
7
- data.tar.gz: e2e704b542d6555b3b0e8eb10d6552b815ea505d3aacaa416792bd132d4242f61898e9712469fe1eff140edf26d823c263cc24d1c92a831190a657c097a4214b
6
+ metadata.gz: 9a273b5ae347832edf2bbe0cbe2ce70c8d7318d3a79535cf64e171fa5d23bdc60fb08c3d8168a251965fce0191c97627ae7d0a6226ae945dc1e7b95273556eb0
7
+ data.tar.gz: c4cdc58a3cec724924aeaecd709dd339b18bb196a9cb7f992266f0744d5f76e91567c046e84afe1b2dde323c3ebd2a1cc1345f693aacf895e0522ccf85a53ff0
@@ -28,6 +28,8 @@ module ActionCable
28
28
  class Orbitcast < Base
29
29
  def initialize(server)
30
30
  super
31
+ # Rails main's Base keeps no `server` reader; read the config now.
32
+ @cable = server.config.cable
31
33
  @publisher = nil
32
34
  @mutex = Mutex.new
33
35
  end
@@ -88,7 +90,7 @@ module ActionCable
88
90
  # `cable[:id]` is ActionCable's own connection tag and `adapter` selects
89
91
  # us; neither is an Orbitcast setting.
90
92
  def cable_options
91
- server.config.cable.to_h.transform_keys(&:to_sym).except(:adapter, :id)
93
+ @cable.to_h.transform_keys(&:to_sym).except(:adapter, :id)
92
94
  end
93
95
 
94
96
  def unsupported_message(operation, channel)
@@ -32,8 +32,9 @@ module Orbitcast
32
32
  V1 = Protocol::V1
33
33
 
34
34
  # Named capabilities reported by `describe`. The relay admits a node by
35
- # envelope version and capability, never by build equality.
36
- CAPABILITIES = %w[rails_dispatch].freeze
35
+ # envelope version and capability (its REQUIRED_CAPABILITIES), never by
36
+ # build equality.
37
+ CAPABILITIES = %w[rails_dispatch identify open_channel run_action release].freeze
37
38
 
38
39
  def initialize(config: nil, registry: nil, connection_class: nil, logger: nil)
39
40
  @config = config || Orbitcast.config
@@ -30,6 +30,10 @@ module Orbitcast
30
30
  # treats it.
31
31
  DEFAULT_COMMAND = "serve"
32
32
 
33
+ # Set by Mothership for a vessel it supervises; the relay docks when it
34
+ # sees them (src/config.rs).
35
+ DOCKING_KEYS = %w[MS_PID MS_SHIP].freeze
36
+
33
37
  # Non-secret process environment forwarded to the child in *both* modes.
34
38
  # Anything not listed here, in EXPORTED_KEYS, or (direct mode only) an
35
39
  # `ORBITCAST_*` key of the parent is dropped (`unsetenv_others: true`).
@@ -104,6 +108,7 @@ module Orbitcast
104
108
 
105
109
  def run
106
110
  return exec_direct(verify: false) if passthrough?
111
+ return exec_docked if docked?
107
112
  return exec_serve if command == DEFAULT_COMMAND && rails_application?
108
113
 
109
114
  # Direct invocation: TOML/environment configured, no Rails boot.
@@ -144,6 +149,19 @@ module Orbitcast
144
149
  strip_forbidden(child)
145
150
  end
146
151
 
152
+ # Under Mothership the manifest configures the bay (its env and the
153
+ # docking handshake), so Rails is not booted and the supervisor's MS_*
154
+ # environment reaches the relay.
155
+ def docked?
156
+ DOCKING_KEYS.all? { |key| env[key] && !env[key].empty? }
157
+ end
158
+
159
+ def docked_env
160
+ child = direct_env
161
+ env.each_pair { |key, value| child[key] = value if key.to_s.start_with?("MS_") }
162
+ child
163
+ end
164
+
147
165
  # The positional command, ignoring flags and the values they consume.
148
166
  # `nil` never: a bare invocation is `serve`.
149
167
  def command
@@ -285,6 +303,10 @@ module Orbitcast
285
303
  exec_process(direct_env, *argv, verify: verify)
286
304
  end
287
305
 
306
+ def exec_docked
307
+ exec_process(docked_env, *argv)
308
+ end
309
+
288
310
  def strip_forbidden(child)
289
311
  FORBIDDEN_KEYS.each { |key| child.delete(key) }
290
312
  child
@@ -6,5 +6,5 @@ module Orbitcast
6
6
  # `Cargo.toml` is the release authority; release-please keeps this constant in
7
7
  # lockstep through its extra-file updater. The trailing annotation below is the
8
8
  # updater marker -- do not reformat the line or the bump will silently no-op.
9
- VERSION = "0.3.1" # x-release-please-version
9
+ VERSION = "0.3.3" # x-release-please-version
10
10
  end
Binary file
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.1",
2
+ "version": "0.3.3",
3
3
  "target": "x86_64-unknown-linux-gnu",
4
4
  "features": [
5
5
  "postgres"
@@ -8,7 +8,7 @@
8
8
  1
9
9
  ],
10
10
  "rust_toolchain": "1.99",
11
- "commit": "b9d10e789b0530850e7ce4e7788111ce9d012a2f",
11
+ "commit": "cc6948367f74975703b65a483928f47ac400e009",
12
12
  "glibc_floor": "2.34",
13
13
  "gem_platform": "x86_64-linux-gnu"
14
14
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orbitcast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - Abdelkader Boudih