Elektrine lite

← Feed

@mattiem@mastodon.social

Post #1810481

2026-04-30 13:38 UTC

The day's plans have gone sideways. So! Do you have any Swift Concurrency questions? Or, (dare I ask) ideas on things you'd like changed?? Hit me with it!

Replies (8)

  • @bok@mastodon.social 2026-04-30 13:47

    @mattiem@mastodon.social if you could change it to be easy to understand, hard to get wrong, and also perfect and bug free I'm sure there would be many appreciative folks out there! 🙃

    Open ##2625576

  • @sjs@techhub.social 2026-04-30 15:10

    @mattiem@mastodon.social In which kinds of circumstances are fire-and-forget tasks acceptable? When a view’s button handler wants to call an async method for short-lived work it seems weird to spin up a task, but it’s easy and convenient. Keeping track of every task is a lot of overhead.

    Open ##2625581

  • @agarrharr@mstdn.social 2026-04-30 16:05

    @mattiem@mastodon.social I tried turning on Swift 6 language mode for one of my modules in a local SPM package, but I get a warning that it will become an error in the Swift 6 language mode...

    Open ##2625585

  • @patters@mastodon.social 2026-04-30 17:44

    @mattiem@mastodon.social biggest pain point at scale: order races. Not sure if it needs to be addressed in the language or in specific cases. One example: rapidly yielding items to an AsyncStream on the main thread (which have an implicit serial order) will not always be vended in order, e.g. in a `for await item in stream` loop running elsewhere. Generally, there are *some* actor patterns that also want there to be some concept of a serialization layered into the cooperative queue.

    Open ##2625595

  • @mattiem@mastodon.social perhaps for a blog post some day - what is a general description of a situation for which you think “creating an actor is exactly what is called for” and what is a situation where you look at code and say “oh creating an actor has made things worse”. In the latter case what are alternatives to consider.

    Open ##2625598

  • @AshtonDev@mastodon.social 2026-04-30 23:21

    @mattiem@mastodon.social running a task with a timeout should be easier. It’s a good chunk of boilerplate or a package. Should be in stdlib right?

    Open ##2625599

  • @kasrababaei@mastodon.social 2026-05-02 09:28

    @mattiem@mastodon.social 1. Is there a way to have some glue code that would allow invoking an async method in a synchronous context and uses something like a queue or semaphore to warrant the next expressions are not executed (suspended) until the async work is done?

    Open ##2625601

  • @kasrababaei@mastodon.social 2026-05-02 09:31

    @mattiem@mastodon.social 2. In a closure that mutates self when neither self nor the closure is Sendable, is it possible to tell the compiler that I don’t care about the state of self without making the whole object, ie self, unchecked Sendable? Example: a VM that invokes a closure which fetches something from the BE, and then mutates some value on self.

    Open ##2625603