Repository navigation
feat: subscriber registry for account-change callbacks (0.2.0) - #1
Merged
Merged
Conversation
Replace the single global on_account_change callback with a named subscriber registry so multiple consumers can react to account changes without clobbering each other. - Add Solrengine::Realtime.subscribe(name, &block) / unsubscribe(name) - AccountMonitor dispatches to all registered subscribers via Solrengine::Realtime.dispatch(wallet_address) - A raising subscriber is rescued and logged (Rails.logger when available, otherwise stderr); remaining subscribers still run - Legacy on_account_change= assignment keeps working: it registers under the reserved :legacy_on_account_change name, and re-assignment replaces it (0.1 semantics preserved); soft-deprecated in CHANGELOG - Bump version to 0.2.0, add CHANGELOG.md, add tests + CI test job Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Replaces the single global
on_account_changecallback with a subscriber registry so multiple consumers (e.g. the newsolrengine-sdpengine plus a host app's own listener) can react to the same account-change stream without clobbering each other.What changed
Solrengine::Realtime.subscribe(name, &block)/unsubscribe(name)— a named registry;AccountMonitordispatches to all subscribers.on_account_change=preserved: it registers under a reserved name, so existing apps keep working (soft-deprecated, noted in CHANGELOG).Why
The
solrengine-sdpengine depends on~> 0.2for this. Without the registry, the engine's doorbell broadcaster would overwrite a host app's own realtime callback — breaking the "both custody models in one app" story.Tests
8 runs, 16 assertions, 0 failures (standalone minitest, the family convention).
🤖 Generated with Claude Code