Class: AsyncapiCable::Runtime::ContractRegistry
- Inherits:
-
Object
- Object
- AsyncapiCable::Runtime::ContractRegistry
- Defined in:
- lib/asyncapi_cable/runtime/contract_registry.rb
Overview
Runtime source of truth for broadcast validation: the committed
asyncapi/<schema>.yaml artifacts, parsed and memoized. This is the
read side of the contract; the write side (RSpec specs ->
MetadataStore -> AsyncapiWriter) is untouched and remains the
authoring path. See docs/exec-plans/asyncapi-cable-runtime-validation.md (D1).
Defined Under Namespace
Classes: Match
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.broadcast_schemas_for(stream) ⇒ Object
23 |
# File 'lib/asyncapi_cable/runtime/contract_registry.rb', line 23 def broadcast_schemas_for(stream) = instance.broadcast_schemas_for(stream) |
.instance ⇒ Object
15 16 17 |
# File 'lib/asyncapi_cable/runtime/contract_registry.rb', line 15 def instance @instance ||= new end |
.reset! ⇒ Object
19 20 21 |
# File 'lib/asyncapi_cable/runtime/contract_registry.rb', line 19 def reset! @instance = nil end |
Instance Method Details
#broadcast_schemas_for(stream) ⇒ Object
26 27 28 |
# File 'lib/asyncapi_cable/runtime/contract_registry.rb', line 26 def broadcast_schemas_for(stream) channels.select { |match| match.matcher.match?(stream) } end |
#channels ⇒ Object
30 31 32 |
# File 'lib/asyncapi_cable/runtime/contract_registry.rb', line 30 def channels @channels ||= load_channels end |