Repository navigation
feat: publish / subscribe for Linkable contracts (#391, stage 1) - #400
Merged
lxsaah merged 1 commit intoNov 2, 2026
Merged
Conversation
Core: OutboundLinkBuilder / InboundLinkBuilder gain with_schema(name, version). push_outbound / push_inbound report it via reg.schema(..) before validation, so a link carries its contract's schema like the schema() call linked_to made before the link. aimdb-data-contracts: publish(handle, address) / subscribe(handle, address) return plain OutboundLink / InboundLink with T's own codec and schema, so every connector extension (with_qos, with_link_codec, ...) applies unchanged. linked_to / linked_from / *_with now register through the same helpers via reg.output / reg.input; behaviour is unchanged. Linkable gets #[diagnostic::on_unimplemented] for the not-a-contract case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stage 1 of #391, into the #392 feature branch.
Core
OutboundLinkBuilder/InboundLinkBuildergainwith_schema(name, version), which reports the record's schema when the link is registered, likeRecordRegistrar::schema.push_outbound/push_inboundreport it before validation, so a rejected link still reports it, aslinked_to'sschema()call did. A different schema on the same record still conflicts atbuild().aimdb-data-contracts
publish(handle, address)/subscribe(handle, address)return a plainOutboundLink/InboundLinkwithT's own codec (link_codecs::Default) andT::NAME/T::VERSIONas schema.#[link_address]keys).with_qos,with_retain,with_depth, …) applies without new impls, and.with_link_codec(Json)replaces the codec.linked_to/linked_from/linked_*_withnow register through the same helpers, viareg.output/reg.input. Their behaviour is unchanged, and their existing tests pass untouched.Linkablegets#[diagnostic::on_unimplemented]:`X` is not a `Linkable` contract/`X` has no wire format.Linkableand module docs point topublish/subscribe.Tests
with_schema_reports_the_record_schema:publish_and_subscribe_register_like_the_linked_verbs: the same URLs, config and graph schema aslinked_to/linked_from, from a bare address and from a full URL.publish_and_subscribe_take_the_knobs:with_qos/with_retainonpublish,with_qosonsubscribe.compile_fail,E0277doctest onpublishfor a record type that isn'tLinkable.Checks
CI doesn't run on PRs into the feature branch, so I ran these locally:
aimdb-coretests withstd,tracing,observability(311) and withallocthumbv8mbuildaimdb-data-contractswith the full feature set and with--no-default-features --features alloc,linkablelink_ext_tests-D warnings)cargo docwith-D warningsfor core and data-contractscargo check -p tokio-mqtt-connector-demoNext
mqtt-connector-demo-commonand move both demos toconnect+publish/subscribe.PushButton.Related Issue
🤖 Generated with Claude Code