Changes between Version 1 and Version 2 of Ticket #35169, comment 9
- Timestamp:
- Feb 6, 2024, 7:36:19 AM (10 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35169, comment 9
v1 v2 1 1 @Michael. `set_script_prefix` targets a `Local`, so if we change thread maybe the value gets lost, but I'm not seeing yet how that can be happening (in anything related to 1d1ddffc27cd55c011298cd09bfa4de3fa73cf7a) — the `create_task` call uses the current event loop, so the same thread... 🤔 — Happy to have a look once you've got a reproduce. Thanks! 2 3 4 Update: from the asgiref.local.Local doctoring: 5 6 > In async threads, local means in the same sense as the `contextvars` 7 > module - i.e. a value set in an async frame will be visible: 8 > 9 > - to other async code `await`-ed from this frame. 10 > - to tasks spawned using `asyncio` utilities (`create_task`, `wait_for`, 11 > `gather` and probably others). 12 > - to code scheduled in a sync thread using `sync_to_async` 13 14 So, exactly, the move to using a subtask (for disconnect handling) should make no difference.