Skip to content

docs: lead with the handlers package over csms.On in README and examples - #8

Merged
shiv3 merged 1 commit into
mainfrom
docs/handler-registration-examples
Jun 18, 2026
Merged

docs: lead with the handlers package over csms.On in README and examples#8
shiv3 merged 1 commit into
mainfrom
docs/handler-registration-examples

Conversation

@shiv3

@shiv3 shiv3 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

Follow-up to #7. Makes the README quickstart and the CSMS examples register handlers via the typed handlers package (RegisterCSMS + UnimplementedCSMSHandler) instead of csms.On, since the handler-interface pattern is the recommended approach.

Changes

  • README CSMS quickstart: define a csmsHandler embedding v16h.UnimplementedCSMSHandler and register with v16h.RegisterCSMS. csms.On kept as a documented single-handler / dynamic-registration alternative.
  • examples/csms-minimal, examples/migration-after: small handler structs embedding UnimplementedCSMSHandler.
  • examples/csms-full: *app now implements v16h.CSMSHandler (embeds UnimplementedCSMSHandler); the 10 per-message closures become methods registered in a single RegisterCSMS call. Shared accepted/invalid locals became package vars idTagAccepted/idTagInvalid.

Unimplemented messages return a NotSupported CallError automatically via the embedded type.

Test plan

  • go build ./..., go vet ./examples/..., gofmt -l all clean.

🤖 Generated with Claude Code

The typed handler interfaces + RegisterCSMS/RegisterCP are the recommended way
to register handlers, so make the README quickstart and the CSMS examples use
them: embed UnimplementedCSMSHandler and implement only the messages you handle.

- README CSMS quickstart uses v16h.RegisterCSMS; csms.On kept as a documented
  single-handler/dynamic alternative.
- csms-minimal, migration-after: small handler structs.
- csms-full: *app implements CSMSHandler (embeds UnimplementedCSMSHandler);
  the per-message closures become methods registered in one RegisterCSMS call.
@shiv3
shiv3 merged commit 5d1cd30 into main Jun 18, 2026
5 checks passed
@shiv3
shiv3 deleted the docs/handler-registration-examples branch June 18, 2026 11:11
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