Skip to content

feat: add no_std arksync-bus foundation#33

Merged
theredfish merged 1 commit into
mvpfrom
feat/STA-39-arksync-messaging
May 30, 2026
Merged

feat: add no_std arksync-bus foundation#33
theredfish merged 1 commit into
mvpfrom
feat/STA-39-arksync-messaging

Conversation

@theredfish
Copy link
Copy Markdown
Owner

@theredfish theredfish commented May 28, 2026

Summary

This PR introduces arksync-bus as a generic EventBus layer instead of a central crate owning bounded-context payloads.

Current direction:

  • arksync-bus owns the generic EventBus infrastructure: envelopes, producer, rules, filters, sinks, and codec helpers.
  • Bounded contexts own their published events close to their own infrastructure/events layer, for example arksync-sensor::infrastructure::events::SensorEvent.
  • The MVP starts with local in-process delivery so Knot and Hub can communicate without MQTT or a broker.
  • MQTT remains a future delivery adapter: the EventBus can later route matching events to a MqttSink backed by minimq and Mosquitto.

EventBus Shape

The rule model separates filtering, delivery, and persistence:

for event in events {
    for rule in rules {
        if !rule.filter(event) {
            continue;
        }

        match rule.persistence() {
            Persistence::Durable => outbox.push(rule, event),
            Persistence::Volatile => {}
        }

        match rule.delivery() {
            Delivery::Local => local_channel.publish(event),
            Delivery::Mqtt { topic } => mqtt.publish(topic, event),
            Delivery::Both => {
                local_channel.publish(event);
                mqtt.publish(topic, event);
            }
        }
    }
}

For this PR, only local volatile delivery is implemented. Persistence and MQTT are intentionally kept as later adapters.

Boundaries

  • arksync-bus must not define sensor-specific payloads such as readings, sensor addresses, firmware metadata, or driver details.
  • arksync-sensor remains responsible for sensor concepts and published sensor events.
  • arksync-knot publishes bounded-context events.
  • arksync-hub subscribes locally for the MVP and updates projections/use cases.

Expected MVP flow:

arksync-knot --EventEnvelope<SensorEvent>--> local arksync-bus/channel --> arksync-hub

Validation

  • arksync-bus core remains no_std.
  • Postcard remains the canonical binary codec for serializable envelopes/events.
  • Integration tests cover a local sensor event passing through the EventBus.

@theredfish theredfish changed the title feat: add arksync messaging contracts feat: add no_std EventBus foundation May 29, 2026
@theredfish theredfish changed the title feat: add no_std EventBus foundation feat: add no_std arksync-bus foundation May 29, 2026
@theredfish theredfish force-pushed the feat/STA-39-arksync-messaging branch from 75b6407 to e79e934 Compare May 30, 2026 01:37
@theredfish theredfish merged commit 6e9b7c2 into mvp May 30, 2026
5 checks passed
@theredfish theredfish deleted the feat/STA-39-arksync-messaging branch May 30, 2026 01: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.

1 participant