Repository navigation
refactor(stream): clarify lifecycle and raw frame ownership - #48
Merged
Richard-LZ-Zhang merged 2 commits intoNov 2, 2026
Merged
Richard-LZ-Zhang merged 2 commits into
Richard-LZ-Zhang merged 2 commits into
Conversation
Richard-LZ-Zhang
merged commit Nov 2, 2026
7b91777
into
codex/order-lifecycle-storage
5 checks passed
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.
The shared Stream previously selected between raw and decoded parsing hooks, while connection status changes were split between the receive loop and a generic status helper. This change gives each adapter one raw-frame entry point and makes lifecycle transitions update their related state before publishing status events.
Changes:
start()and clarify that it schedules receiving without waiting for connection, subscriptions or book readiness. Give the receiver task and receive loop descriptive names.status()with private connection/gap/resync/error operations; retain a separate status emitter for construction and venue-specific redaction. WebSocket and gRPC loops use the same explicit lifecycle operations.handle_raw(raw) -> list[Event]the sole parsing contract. Adapters own framing, decoding and native/Python fallback. Preserve gRPC's decoded-message hook.websocket_connection_openeracross adapters and tests.docs/streaming.md.Validation against experimental base
1dc1999and SDK head7a71bd9:git diff --checkpassed. No live venue or account execution tests were run.Compatibility: the approved constructor/hook/status renames require custom subclasses and diagnostic callers to migrate as documented. This PR targets
codex/order-lifecycle-storage; it does not merge the experiment into publicmainor change release/version pins. MarketDataStream/UserDataStream separation, immutable public books, change waiting and queue-policy redesign remain outside this PR.Review limitation: automatic approval rejected the optional external Codex CLI review because it would export repository content. No external CLI review was run; the in-session reviews above completed.