docs: lead with the handlers package over csms.On in README and examples - #8
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #7. Makes the README quickstart and the CSMS examples register handlers via the typed
handlerspackage (RegisterCSMS+UnimplementedCSMSHandler) instead ofcsms.On, since the handler-interface pattern is the recommended approach.Changes
csmsHandlerembeddingv16h.UnimplementedCSMSHandlerand register withv16h.RegisterCSMS.csms.Onkept as a documented single-handler / dynamic-registration alternative.UnimplementedCSMSHandler.*appnow implementsv16h.CSMSHandler(embedsUnimplementedCSMSHandler); the 10 per-message closures become methods registered in a singleRegisterCSMScall. Sharedaccepted/invalidlocals became package varsidTagAccepted/idTagInvalid.Unimplemented messages return a
NotSupportedCallError automatically via the embedded type.Test plan
go build ./...,go vet ./examples/...,gofmt -lall clean.🤖 Generated with Claude Code