# What's the use case for io.async?

**URL:** <https://ziggit.dev/t/whats-the-use-case-for-io-async/12439>\
**Category:** Brainstorming\
**Tags:** standard-library\
**Created:** [October 10, 2025, 4:21pm UTC](https://ziggit.dev/t/whats-the-use-case-for-io-async/12439 "2025-10-10T16:21:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sze](https://ziggit.dev/user_avatar/ziggit.dev/sze/32/496_2.png) [@Sze](https://ziggit.dev/u/Sze)\
**Post date:** [October 10, 2025, 6:37pm UTC](https://ziggit.dev/t/whats-the-use-case-for-io-async/12439/2 "2025-10-10T18:37:49Z")

</div>

> [@lalinsky](#):
>
> However, when would you actually want to use `io.async`? If you are fine with the code executing serially, why would you not just call it as a function?

If the program runs in single-threaded blocking mode async is forced to just call the function, however otherwise you still want to run the asynchronous code asyncronously. (not everyone wants to run their program in blocking mode and the code shouldn’t need to be changed to run it in non-blocking mode)

If you always just use function calls (and this code is part of a library) then the user doesn’t have the option to run it asynchronous.

> [@lalinsky](#):
>
> I’d much prefer if we have `io.spawn` that explicitly runs the code in some kind of background executor.

`io.async` allows that, but if there is no possibility to have a background executor, you can still run the code in single threaded blocking mode, which is slower but enables more use cases. Giving more options to the user.

> [@lalinsky](#):
>
> However, my main question is, what’s one good use case for `io.async`?

`io.async` enables implementation agnostic expression of the actual asyncrony and concurrency (via io.asyncConcurrent), allowing users to write the code once and use it with multiple different io implementations.

> [@Asynchrony is not Concurrency](https://ziggit.dev/t/asynchrony-is-not-concurrency/11049):
>
> This is a follow up post about async I/O in Zig that talks about these concepts in a more general manner. Hopefully this will clarify some of the ideas behind the new design that I feel were not fully grasped by a lot of people from the previous post.

---

_[View the full topic](https://ziggit.dev/t/whats-the-use-case-for-io-async/12439)._
