feat: modernization phase 3 PR3#47
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR continues the modernization work by converting sACNDiscoveryReceiver from a GCD/delegate-based receiver to a Swift Concurrency actor pinned to the shared NIO event loop, exposing discovery/events/debug output via AsyncStreams and adding characterization + gated loopback tests.
Changes:
- Refactor
sACNDiscoveryReceiverinto anactorwithasynclifecycle/mutation APIs andAsyncStreamoutputs (discovery,events,debugLog), including a lifecycle “busy” gate (receiverBusy) and NIO scheduled heartbeat. - Remove the discovery receiver delegate protocol and update docs/README to reflect the new actor/stream-based API.
- Add packet fixtures and new tests (seam-based characterization + gated end-to-end loopback) for paged assembly, malformed packet logging, and source-loss behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/sACNKitTests/PacketFixtures.swift | Adds a universe-discovery packet builder fixture for injection-based discovery testing. |
| Tests/sACNKitTests/DiscoveryReceiverTests.swift | Adds seam-based characterization tests plus an env-gated loopback test for actor-path inbound delivery. |
| Sources/sACNKit/Receiver/sACNReceiver.swift | Adds receiverBusy validation error for in-flight lifecycle/reconfiguration operations. |
| Sources/sACNKit/Receiver/sACNDiscoveryReceiver.swift | Converts discovery receiver to an actor with async lifecycle, stream outputs, scheduled heartbeat, and test seams. |
| Sources/sACNKit/Receiver/DiscoveryReceiverSource.swift | Removes dead lastNotifiedUniverseCount state from discovery source tracking. |
| Sources/sACNKit/Receiver/Delegate/sACNDiscoveryReceiverDelegate.swift | Deletes the delegate protocol now superseded by AsyncStream outputs. |
| Sources/sACNKit/Documentation.docc/sACNKit.md | Updates package overview to reflect sACNDiscoveryReceiver as an actor with streams. |
| README.md | Updates public-facing usage docs and adds an actor/stream example for discovery receiver. |
| docs/modernization/phase-4.md | Updates Phase 4 PR3 notes with completed implementation details and testing coverage. |
| AGENTS.md | Updates repo structure notes to reflect discovery receiver’s actor/stream API. |
| .claude/rules/timing.md | Updates timing rules to reflect discovery receiver heartbeat running via NIO scheduled tasks. |
| .claude/rules/threading.md | Updates threading guidance to reflect discovery receiver no longer being a GCD receiver component. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.