Commit a115170
authored
E. Typed `SubscriptionTier` enum
================================
`crates/thetadatadx/src/mdds/tier.rs` introduces a four-variant
`SubscriptionTier` enum (`Free`, `Value`, `Standard`, `Pro`) replacing
the prior `Option<i32>` representation of the `stock_tier` and
`options_tier` fields on `MddsClient`. The discriminant mirrors the
wire byte; `from_wire(i32)` decodes (returning `None` for unknown
values rather than silently coercing); `max_concurrent_requests`
codifies the `2^tier` semaphore semantics. Re-exported as
`thetadatadx::SubscriptionTier`. The wire-side `auth::nexus::AuthUser`
keeps its raw `Option<i32>` fields so deserialization stays
infallible for unknown future tiers; the typed enum is the post-
decode in-memory shape callers see. Unit tests cover the
round-trip, the unknown-value rejection, and the powers-of-two
semaphore math (1, 2, 4, 8).
F. `ArcSwap<StreamingSlot>` state machine
=========================================
The streaming side of `ThetaDataDx` collapses to a single
`ArcSwap<StreamingSlot>` cell walking
`Idle -> Live -> Stopped -> Live -> Stopped`. The previous trio of
coordinated fields — `Mutex<Option<FpssClient>>`,
`Mutex<Option<StreamingDispatcher>>`, `AtomicBool was_streaming` —
went away. Read paths (`is_streaming`, `connection_status`,
`with_streaming`, every per-subscription forwarder) collapse to one
atomic load on the slot and a borrow of the contained
`Arc<FpssClient>`. Lifecycle paths retain serial semantics through
an rcu-CAS install and an atomic swap-to-`Stopped`, with the previous
`Live` payload (if any) running the FPSS-then-dispatcher shutdown
sequence. The `dispatcher` field sits in a `Mutex<Option<...>>`
inside `Live` because `StreamingDispatcher::shutdown` consumes by
value; the lock is hit only by `stop_streaming` and
`dropped_event_count`, never by hot-path readers. Adds `arc-swap`
1.7 to the runtime dependencies. A state-machine walk through
`Idle -> Live -> Stopped -> Live -> Stopped` and a CAS-race test
covering the rejected double-install live alongside the existing
`reconnect_streaming` regression tests. The `Drop` contract is
documented in place: stop_streaming is idempotent because only a
`Live` slot triggers the shutdown sequence.
G. Layout moves
===============
Top-level mdds-specific modules move under `mdds/`:
endpoint.rs -> mdds/endpoint_args.rs (rename clarifies args-only)
macros.rs -> mdds/macros.rs
registry.rs -> mdds/registry.rs
validate.rs merged into mdds/validate.rs
wire_semantics.rs -> mdds/wire_semantics.rs
`mdds/validate.rs` now hosts the canonical two-arg validators
(date / expiration / strike / symbol / interval / right / year)
plus a `validate_date_required` single-arg adapter the
`parsed_endpoint!` macro expansion needs. The macro switches to the
fully-qualified `$crate::mdds::validate::validate_date_required`
path so it expands cleanly from generated endpoint bodies; the
generator emit (`build_support/endpoints/render/mdds.rs`) follows.
`unified.rs` is renamed to `client.rs` so the filename matches the
primary type (`ThetaDataDx`). The frames module folds into a
directory: `frames.rs` + `frames_generated.rs` -> `frames/mod.rs` +
`frames/generated.rs`. The build-time generator paths
(`build_support/ticks/mod.rs`, `build_support/ticks/rust_frames.rs`)
follow.
The `tdbe::types::*_generated.rs` trio segregates under
`tdbe::types::generated/`: `enums_endpoint.rs`, `tick.rs`,
`tick_layout_asserts.rs`, with a `mod.rs` documenting the
directory. The hand-written siblings keep their `include!` sites
(now `include!("generated/...rs")`); `mod generated;` is declared
privately in `types/mod.rs`. The build-time generator paths
(`build_support/endpoints/render/sdk_files.rs`,
`build_support/ticks/tdbe_structs.rs`,
`build_support/ticks/mod.rs`) follow.
Re-exports in `lib.rs` keep the public surface stable:
pub use mdds::endpoint_args as endpoint;
pub use mdds::registry::{by_category, find, ..., EndpointMeta, ENDPOINTS, ...};
pub use client::{ConnectionStatus, SubscriptionInfo, ThetaDataDx};
`thetadatadx::endpoint::*` and `thetadatadx::ENDPOINTS` /
`EndpointMeta` continue to resolve.
Build-script `[path = ...]` mounts (`build_support/mod.rs`,
`crates/thetadatadx/src/bin/generate_sdk_surfaces.rs`) follow the
file moves. `git mv` was used everywhere file blame is meaningful so
history follows the rename.
H. LOW batch
============
* 3.1 (`mdds.connect_timeout_secs`) — already shipped in Wave 2.
* 3.2 (`extract_*_column` return type) — kept as `Vec<Option<T>>`.
The three helpers are public surface, exercised by benches,
integration tests, the macro-driven list endpoints, and the
Polars / Arrow column projections. Switching to
`impl Iterator<Item = Option<T>>` would force every caller
(including generated FFI bindings) to deal with the iterator
shape and would lose the "missing-header -> empty result" early
return the warn-log path relies on. The Vec allocation is one
per column per call, never on a per-tick path.
* 3.5 (`FpssConnectArgs` struct) — deferred to Wave 4 B4 as a
breaking signature change. Not landed here.
* 3.9 (`Drop::drop` idempotency on `ThetaDataDx`) — addressed in F.
The state machine guarantees `stop_streaming` runs the FPSS /
dispatcher shutdown at most once; `Drop::drop`'s doc comment now
records the contract in-place.
* 3.10 (`#[allow(dead_code)]` on `flatfiles::framing::msg`) —
removed. Every one of the ten `u16` wire-code constants is
genuinely used by `flatfiles::request` and `flatfiles::session`.
The attribute was a false positive; clippy stays green.
Version bump: 8.0.36 -> 8.0.37 across every crate manifest,
`sdks/typescript/package.json` (+ optionalDependencies, + the three
per-platform `npm/<platform>/package.json` files), Cargo.lock, and
the matching CHANGELOG entry mirrored to `docs-site/docs/changelog.md`.
1 parent de1c714 commit a115170
47 files changed
Lines changed: 1196 additions & 1000 deletions
File tree
- crates
- tdbe/src/types
- generated
- thetadatadx
- build_support
- endpoints/render
- ticks
- src
- bin
- flatfiles
- frames
- mdds
- docs-site/docs
- ffi
- sdks
- python
- typescript
- npm
- darwin-arm64
- linux-x64-gnu
- win32-x64-msvc
- tools
- cli
- mcp
- server
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
8 | 66 | | |
9 | 67 | | |
10 | 68 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
0 commit comments