feat: allow custom priority for workers#377
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds QoS support for NativeScript workers: the Worker constructor parses an optional ChangesWorker Thread Quality of Service Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@NativeScript/runtime/Worker.mm`:
- Around line 114-120: The ios QoS mapping in the priority branch (checks for
"userInteractive", "userInitiated", "default", "utility") incorrectly hardcodes
hex literals; change those branches to use the NSQualityOfService constants
(e.g., NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated,
NSQualityOfServiceDefault/NSQualityOfServiceUtility) and modify the "default"
branch so it does not force an explicit QoS value (i.e., leave qos unset or set
to the sentinel used by worker->Start(..., qos) to indicate “do not set QoS”);
update the code around worker->Start(..., qos) to pass that sentinel when
priority == "default" and ensure all other branches use the named
NSQualityOfService* constants instead of hex literals.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 236f41b7-1842-487f-8583-141ad44b2b77
📒 Files selected for processing (3)
NativeScript/runtime/DataWrapper.hNativeScript/runtime/Worker.mmNativeScript/runtime/WorkerWrapper.mm
Summary by CodeRabbit
New Features
Bug Fixes