Skip to content

Crossplot route handshake - #10

Open
andrewfullard wants to merge 4 commits into
SvenMarcus:masterfrom
andrewfullard:feature/crossplot-route-handshake
Open

andrewfullard wants to merge 4 commits into
SvenMarcus:masterfrom
andrewfullard:feature/crossplot-route-handshake

Conversation

@andrewfullard

@andrewfullard andrewfullard commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Requires serialization + merge of the observable fix. This fixes a lot of issues around startup of many plugins that perform many subscriptions

andrewfullard and others added 4 commits October 17, 2026 15:35
Notify iterates over a copy of the listener list, so listeners can detach
themselves or others mid-notification without skipping callbacks.
Adds has_listeners() to check whether any listener is attached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- serializer escapes strings and keys with %q, supports boolean and
  number keys, and returns nil for unsupported values (functions,
  userdata, cycles, numbers that do not round-trip) instead of emitting
  invalid or unsafe Lua. Function serialization via string.dump is removed.
- MessageQueue serializes values when they are queued, so unsupported
  payloads are rejected immediately (queue_value returns false), and
  checks whether a mailbox is free without deserializing it.
- GlobalValueKeyValueStore gains store_serialized, take (read and clear)
  and is_empty; store now returns whether the value was stored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-handshake

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Galactic plots could publish events before other plots had registered
their listeners with the main bus, so early messages were lost.

- Subscribe/unsubscribe messages are merged into a single ordered
  busid:main:route channel carrying {name, event, active}. An endpoint
  only registers on its first local listener for an event and only
  unregisters after its last one detaches.
- A bus created with an initial_route_source defers route messages and
  sends its complete listener list in one message via
  submit_initial_routes(required_sources).
- The main bus (crossplot:main) holds publications until every required
  startup source (default "galactic-core") has reported, then sets
  busid:main:ready.
- Notifications are taken (read and cleared) before callbacks run, so a
  failing listener cannot block the mailbox; malformed notifications are
  dropped. Subscribers are stored as a set and each publication is
  serialized once for all recipients.
- deepcore:galactic registers as "galactic-core" and submits its routes
  after all plugins are loaded; config.required_initial_route_sources can
  name additional sources to wait for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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