LEARNING THREADAsync workers
C# / CancellationToken
THE QUESTIONWhy does the worker keep running after cancellation?
Source: your learning note
YOUR NOTE / EXAMPLEI built it. Then it kept running.
I created an async worker and passed a CancellationToken. The task kept running after I cancelled it. I understand async/await, but shutdown still feels unclear.
await worker.RunAsync(token);
// Where should cancellation be checked?
Capture the attempt, the result, and the unresolved question.
POSSIBLE AI REVIEW / NOT A LIVE RESULTA gap worth practicing.
Your note suggests that cancellation handling needs practice. It does not establish whether the issue is in the caller, the loop, or the operation itself.
Evidence: "The task kept running after I cancelled it."
AI conclusions should show their source and their limits.
POSSIBLE NEXT STEP / YOUR DECISIONMake shutdown observable.
- Add a cancellation check inside the worker loop.
- Write a test that cancels an active operation.
- Check the shutdown result before accepting a skill update.
Planned choices: Accept / Edit / Skip
A practice suggestion, not a claim of mastery.