feat: add unified ctrl_c() signal handling#140
Conversation
8b6bcb9 to
823ba05
Compare
823ba05 to
6edc25c
Compare
|
/claude |
|
/kimi |
|
/codex |
🤖 Kimi Code ReviewSecurity ReviewCritical - None found Bug Review1. Race condition in signal handler registration (Medium)File: The Fix: Use a proper synchronization mechanism or ensure the handler registration is atomic. 2. Potential panic in signal handler (Medium)File: The Fix: Return a 3. Unbounded memory growth in signal subscribers (Low)File: The Fix: Implement cleanup for dropped subscribers or use a bounded collection. 4. Inconsistent API between tasks and threads (Low)File: The tasks version returns a future ( Fix: Consider unifying the API or clearly documenting the difference. Performance IssuesNone found - the changes appear to be focused on functionality rather than performance optimization. Automated review by Kimi (Moonshot AI) |
🤖 Codex Code ReviewI can’t review PR #140 yet because there are no local changes to diff. Please provide the PR diff or check out the PR branch/commit locally (then I can re-run Automated review by OpenAI Codex · custom prompt |
Replace JoinHandle-based join() with completion signal pattern: - tasks: use tokio::sync::watch channel - threads: use Condvar with completion flag All clones of ActorRef can now call join() and be notified when the actor stops, instead of only the first caller.
Response to Kimi Review
|
EDIT (27-01-2026):
Ran Devin review and fixed all found issues:
https://app.devin.ai/review/lambdaclass/spawned/pull/140
Summary
Adds
rt::ctrl_c()to both tasks and threads modules with identical call syntax:Also adds
join()method toActorReffor waiting on actor completion:Includes
signal_testandsignal_test_threadsexamples demonstrating usage.Closes #58
Closes #116
Test plan
cargo build --workspacecargo test --workspacecargo clippy --workspacecargo run --bin signal_test -- async- press Ctrl+C, verify teardown runscargo run --bin signal_test -- blocking- press Ctrl+C, verify teardown runscargo run --bin signal_test -- thread- press Ctrl+C, verify teardown runscargo run --bin signal_test_threads- press Ctrl+C, verify teardown runs