feat: wire push-dispatch into the Node and Java shells - #497
Conversation
Shells matched on the storage backend themselves to build a WakeSource. Move that map into WakeSource::for_storage and expose Scheduler::enable_push_dispatch, which also exists as a logged no-op without the feature so shells need no cfg.
Adds the push-dispatch cargo feature and a pushDispatch worker option, accepted and ignored when the addon is built without the feature.
Adds the push-dispatch cargo feature and a pushDispatch(boolean) builder option, accepted and ignored when the library is built without the feature.
The feature ships in no artifact, so only CI keeps the three binding shells' wiring compiling.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
📝 WalkthroughWalkthroughPush-dispatch adds storage-specific scheduler wake sources, exposes opt-in configuration through Java and Node bindings, moves Python setup into the runtime, documents the option, adds SDK tests, and expands Rust CI feature coverage. ChangesPush-dispatch
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/ci-rust.ymlTraceback (most recent call last): Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #480.
push-dispatchwas implemented in the core but only wired by the Python binding —taskito-nodeandtaskito-javahad zero references to it.Core
Both listener-bearing backends and SQLite were matched on by hand in the Python shell. That map now lives in one place:
WakeSource::for_storage(&StorageBackend)— SQLite shares the storage'sNotify, Postgres/Redis spawn their listener and take its channel.Scheduler::enable_push_dispatch()— the single entry point shells call. It exists in both feature states: withpush-dispatchit installs the source, without it logs and keeps polling. Shells therefore carry no#[cfg]for this at all.Node
push-dispatchcargo feature ontaskito-node.WorkerOptions.push_dispatch→ TSWorkerRunOptions.pushDispatch.within_runtime_if_available—start_workerruns on the JS thread, and the Postgres/Redis listeners need a runtime context.Java
push-dispatchcargo feature ontaskito-java.WorkerOptions.push_dispatch(wire keypushDispatch) →Worker.Builder.pushDispatch(boolean).runtime.enter(), the same patternmesh.rsalready uses on the JNI thread.Python
Collapsed onto the shared entry point: the split SQLite-outside / channel-inside install and the
cfg(all(push-dispatch, any(postgres, redis)))binding gate are gone. Behavior unchanged.Option placement
Python exposes the knob on the queue constructor. Node and Java expose it on worker options — that is where those shells configure the scheduler and where the comparable
meshopt-in lives, and a producer-only process there never starts one.Off by default everywhere, exactly as in Python: the feature is in no shipped artifact, and the option is accepted and ignored without it.
Verification
cargo test --workspace --features push-dispatchgreen; clippy + fmt clean across default,push-dispatch,+postgres,+redis,+mesh,workflows.test/dashboard/*failures are a pre-existing localbuild:dashboardgap, unrelated).CI now runs
cargo test --workspace --features push-dispatchplus apush-dispatch,postgres,redischeck — the feature ships in no artifact, so nothing else keeps the wiring compiling.Summary by CodeRabbit
New Features
pushDispatchconfiguration options to worker APIs.Documentation
Tests