Skip to content

The channel of a claim: view properties, .change handlers, EMIT (format 0.6) - #18

Merged
JohnAmadis merged 1 commit into
mainfrom
feature/claim-channel
Oct 11, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
feature/claim-channel

Conversation

@JaxCalder

Copy link
Copy Markdown

Summary

A claim is now the channel between the application and the view it claimed the display for (format 0.6):

  • Properties: .prop variables the application sets and reads by name with libdmview_prop_set_int/_set_string/_get_int/_get_string. They are read from the view file at claim time, so a wrong name or type fails immediately. Names belong to the view; nothing is global.
  • Changes: what the application sets is taken into the view on the service's thread (libdmview_update(), latency ≤ 100 ms) and runs the view's .change handlers.
  • Events: EMIT "name", n queues in the claim (16 entries, the oldest dropped and counted in dropped) for libdmview_wait_event().
  • Claims are heap objects now, so a thread waiting for events keeps its claim alive even when it is released; the dmview service attaches the view it shows to the display's newest claim (libdmview_attach()).

Used by carhmi-demo's MP3 player (track list, play/pause, progress driven from C, buttons sending events).

Order

Needs todmv with format 0.6 released (choco-technologies/todmv - feature/claim-channel) for the test fixtures.

Test plan

  • ctest: 26/26, including libdmview_claims_are_channels

🤖 Generated with Claude Code

…at 0.6)

A claim is now also the channel between the application and its view:

- properties (.prop variables) the application sets and reads by name -
  libdmview_prop_set_int/_set_string/_get_int/_get_string -, read from the
  view file when it is claimed, so a name or a type the view does not have
  is an error at once; names are the view's own, nothing global;
- what the application sets is taken into the view on the service's
  thread (libdmview_update()), running the view's .change handlers; what
  the view sets itself is what the application reads;
- events the view emits (EMIT "name", n) queue in the claim (16, the
  oldest dropped and counted) for libdmview_wait_event().

Claims are objects of their own now, so a thread waiting for events keeps
one until it is done even when it is released. The dmview service attaches
the view it shows to the display's newest claim (libdmview_attach()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JohnAmadis
JohnAmadis merged commit 87060bd into main Oct 11, 2026
1 of 2 checks passed
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