≈ the.bay.news

Binding a task-local without a closure

Swift Forums
Binding a task-local without a closure
Hi Swift users! I want to talk about making task-locals more flexible while keeping them safe. The latest compiler changes forbid the unsafe way of binding them outside of withValue, but there is still no safe API that covers this use case. Here is the use case and an idea for such API. I have a scope object that is created at the start of a function and ended at the end of it: func handle(request: Request) async { let scope = Context.begin() defer { scope.end() } await process() // e...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.