Skip to content

docs(054): drop backward compatibility, two-ring embedded MQTT outbound - #271

Merged
lxsaah merged 5 commits into
mainfrom
docs/054-no-compat-two-ring
Oct 2, 2026
Merged

lxsaah merged 5 commits into
mainfrom
docs/054-no-compat-two-ring

Conversation

@lxsaah

@lxsaah lxsaah commented Oct 2, 2026

Copy link
Copy Markdown
Contributor
  • One mechanism per direction: InboundDispatch inbound, RoutePublisher
    outbound. Remove Source, pump_source, public inbound_router,
    Connector::publish, TopicProvider and the compatibility adapters;
    with_topic_provider becomes with_topic_writer.
  • Embedded MQTT outbound: route publishers copy raw records into a record
    ring; the session loop stays the only encoder and writes into a
    per-connection bip-buffer write ring with a control-packet reserve.
  • Pump never ends a route on a publish error; document QoS 1
    ack-then-drop and ingest latency on both MQTT backends.
  • Single-branch migration with per-crate table; CI gate lands first.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE

claude added 5 commits October 2, 2026 08:20
- One mechanism per direction: InboundDispatch inbound, RoutePublisher
  outbound. Remove Source, pump_source, public inbound_router,
  Connector::publish, TopicProvider and the compatibility adapters;
  with_topic_provider becomes with_topic_writer.
- Embedded MQTT outbound: route publishers copy raw records into a record
  ring; the session loop stays the only encoder and writes into a
  per-connection bip-buffer write ring with a control-packet reserve.
- Pump never ends a route on a publish error; document QoS 1
  ack-then-drop and ingest latency on both MQTT backends.
- Single-branch migration with per-crate table; CI gate lands first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE
- RoutePublisher becomes poll_ready / buffers / commit / poll_flush: the
  reader serializes topic and payload straight into storage the publisher
  reserved, removing the scratch-to-publisher copy. route_publisher takes a
  RouteSpec and returns a Result.
- Embedded MQTT: one single-producer, single-consumer record ring per
  route, so no lock; the session loop encodes round-robin into the write
  ring, leaving one AimDB copy per message.
- Native MQTT moves owned serializer payloads into rumqttc without copying.
- Alternatives: hand-encoded zero-copy frames (8) and borrowed-bytes
  start_send with a shared ring (9) rejected; ring sizing and bbqueue fit
  added to open questions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE
- Record rings use bbqueue's framed grants (grant, commit with unused
  tail returned, keep/release on read); the write ring uses stream grants
  with grant_exact(frame + reserve) to keep a control-packet reserve.
- BoxedSlice storage sized per route at build, ArcBBQueue halves,
  AtomicCoord; a custom Notifier with atomic waker slots fits poll_ready
  instead of the maitake-sync async notifier.
- Spell out the synchronisation: no lock in the per-message path, only
  waker slots; RMW atomics needed, portable-atomic fallback on thumbv6m.
- Open questions: bbqueue pre-1.0 churn, write ring draining on
  reconnect, inbound chunk channel as a follow-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE
… two steps

- Core ScratchPublisher + SendBytes: native MQTT, KNX, WebSocket and the
  AimX session implement send/send_owned; only embedded MQTT lends buffers.
- Embedded MQTT migrates in two steps (write ring, then record rings),
  with step 1 as a fallback stopping point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE
Each connector's transport task drives both directions: it pushes
received messages into InboundDispatch and pulls serialized messages from
OutboundRoutes when its transport can send. Core runs no per-route pumps;
the record buffers are the outbound queue.

- Removes RoutePublisher, SendBytes, ScratchPublisher, the per-route
  record rings and the custom notifier from the design.
- Embedded MQTT: the action arm pulls from OutboundRoutes under today's
  gate; a bbqueue write ring replaces the per-packet Vec. One copy, zero
  allocations, no lock.
- Native MQTT: a plain publish loop awaiting AsyncClient; errors are
  attributed to the message that caused them.
- Behaviour changes documented: outbound queueing moves into record
  buffers, one send at a time per connector, round-robin fairness.
- The push design is kept as rejected alternative 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EyVFXVWAec2aouRceoGdpE
@lxsaah
lxsaah merged commit dfe6adc into main Oct 2, 2026
6 checks passed
@lxsaah
lxsaah deleted the docs/054-no-compat-two-ring branch October 2, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants