# await

The await keyword or operator suspends asynchronous execution until a Promise, task, or Future completes and then produces its result.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How can I make it easier to use the helper class that lets me pass more than one parameter to co\_await?

DevFeed: [How can I make it easier to use the helper class that lets me pass more than one parameter to co\_await?](<https://devfeed.tech/articles/how-can-i-make-it-easier-to-use-the-helper-class-that-lets-me-pass-more-than-one-parameter-to-co-await-133568.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20261113-00/?p=112856/>)

Author: Raymond Chen

Published: 2026-11-13T15:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [await](<https://devfeed.tech/topics/await.md>), [class](<https://devfeed.tech/topics/class.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>)

Tags: [await](<https://devfeed.tech/tags/await.md>), [code](<https://devfeed.tech/tags/code.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [priority](<https://devfeed.tech/tags/priority.md>), [widget](<https://devfeed.tech/tags/widget.md>)

### AI overview

To avoid making callers name a different "mega-parameter" wrapper for each combination of options, the excerpt has `Widget::start(priority)` return a `with_priority` awaitable that stores a reference to the widget and the chosen priority. A default priority of 0 lets callers write `co_await widget.start()`. The class can also make awaiting the widget directly mean starting with that default priority. The excerpt shows the wrapper forwarding await operations to the widget; omitted code and placeholders mean it does not provide a complete implementation.

### Source excerpt

Remove the need to have to type out the name of the helper. The post How can I make it easier to use the helper class that lets me pass more than one parameter to <CODE>co_await</CODE>? appeared first on The Old New Thing.

## How can I pass more than one parameter to co\_await?

DevFeed: [How can I pass more than one parameter to co\_await?](<https://devfeed.tech/articles/how-can-i-pass-more-than-one-parameter-to-co-await-131222.md>)

Original publisher: [Read original article](<https://devblogs.microsoft.com/oldnewthing/20261112-00/?p=112851/>)

Author: Raymond Chen

Published: 2026-11-12T15:00:00Z

Content type: article

Language: en

Sources: [Raymond Chen](<https://devfeed.tech/sources/raymond-chen.md>)

Topics: [await](<https://devfeed.tech/topics/await.md>), [Parameter](<https://devfeed.tech/topics/parameter.md>)

Tags: [await](<https://devfeed.tech/tags/await.md>), [code](<https://devfeed.tech/tags/code.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [old-new-thing](<https://devfeed.tech/tags/old-new-thing.md>), [operator](<https://devfeed.tech/tags/operator.md>), [parameter](<https://devfeed.tech/tags/parameter.md>), [priority](<https://devfeed.tech/tags/priority.md>), [timeout](<https://devfeed.tech/tags/timeout.md>)

### AI overview

`co_await` accepts one operand, so `(widget, priority)` cannot pass a second argument to `await_suspend`. The excerpt's workaround is to wrap the awaitable and the extra value in a helper object, then await that object; the wrapper forwards the value to an internal suspend method. The author notes this approach is unwieldy.

### Source excerpt

The co_await operator takes only one parameter, but it can be a big parameter. The post How can I pass more than one parameter to <CODE>co_await</CODE>? appeared first on The Old New Thing.

## I Knew the Terms. I Couldn't Explain Them.

DevFeed: [I Knew the Terms. I Couldn't Explain Them.](<https://devfeed.tech/articles/i-knew-the-terms-i-couldn-t-explain-them-130856.md>)

Original publisher: [Read original article](<https://thetshaped.dev/p/i-knew-the-terms-i-couldnt-explain>)

Author: Petar Ivanov

Published: 2026-11-12T11:01:59Z

Content type: article

Language: en

Sources: [The T-Shaped Dev](<https://devfeed.tech/sources/the-t-shaped-dev.md>)

Topics: [data type](<https://devfeed.tech/topics/data-type.md>), [await](<https://devfeed.tech/topics/await.md>), [architecture-components](<https://devfeed.tech/topics/architecture-components.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [after](<https://devfeed.tech/tags/after.md>), [also](<https://devfeed.tech/tags/also.md>), [api](<https://devfeed.tech/tags/api.md>), [api-design](<https://devfeed.tech/tags/api-design.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [array](<https://devfeed.tech/tags/array.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [away](<https://devfeed.tech/tags/away.md>), [bug](<https://devfeed.tech/tags/bug.md>), [can](<https://devfeed.tech/tags/can.md>), [course](<https://devfeed.tech/tags/course.md>), [explain](<https://devfeed.tech/tags/explain.md>), [failed](<https://devfeed.tech/tags/failed.md>), [free](<https://devfeed.tech/tags/free.md>), [i](<https://devfeed.tech/tags/i.md>), [interview](<https://devfeed.tech/tags/interview.md>), [terms](<https://devfeed.tech/tags/terms.md>)

### AI overview

The course targets a gap between recognizing JavaScript concepts and explaining them aloud: learners answer each question before seeing a model answer. In its async example, `forEach` discards promises returned by async callbacks, so the loop finishes before the work; the excerpt also notes that async predicates passed to `filter` are a bug because promises are truthy. It offers `Promise.all(items.map(...))` to await parallel work or `for...of` for sequential work. The course is described as having 660+ questions and architecture scenarios across React, Node.js, TypeScript and system design, with answers tagged by level. The free sample includes three chapters, 76 questions, three architecture scenarios and chapter self-tests. These details come from the supplied excerpt.

### Source excerpt

The interview I almost failed, the course I built around it, and 3 free chapters you can try today.

## Native Asyncio Comes to the Snowflake Python Connector

DevFeed: [Native Asyncio Comes to the Snowflake Python Connector](<https://devfeed.tech/articles/native-asyncio-comes-to-the-snowflake-python-connector-127038.md>)

Original publisher: [Read original article](<https://medium.com/snowflake/native-asyncio-comes-to-the-snowflake-python-connector-5941385ac80e?source=rss----34b6daafc07---4>)

Author: Patryk Czajka

Published: 2026-11-10T17:24:52Z

Content type: release

Language: en

Sources: [Snowflake Builders](<https://devfeed.tech/sources/snowflake-builders.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [await](<https://devfeed.tech/topics/await.md>), [Python](<https://devfeed.tech/topics/python.md>), [FastAPI](<https://devfeed.tech/topics/fastapi.md>)

Tags: [2017](<https://devfeed.tech/tags/2017.md>), [3](<https://devfeed.tech/tags/3.md>), [addition](<https://devfeed.tech/tags/addition.md>), [aio](<https://devfeed.tech/tags/aio.md>), [api](<https://devfeed.tech/tags/api.md>), [applications](<https://devfeed.tech/tags/applications.md>), [arrow](<https://devfeed.tech/tags/arrow.md>), [async](<https://devfeed.tech/tags/async.md>), [asyncio](<https://devfeed.tech/tags/asyncio.md>), [await](<https://devfeed.tech/tags/await.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [connect](<https://devfeed.tech/tags/connect.md>), [core](<https://devfeed.tech/tags/core.md>), [dashboard](<https://devfeed.tech/tags/dashboard.md>), [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [data-quality](<https://devfeed.tech/tags/data-quality.md>), [event](<https://devfeed.tech/tags/event.md>), [event-loop](<https://devfeed.tech/tags/event-loop.md>), [fan](<https://devfeed.tech/tags/fan.md>), [python](<https://devfeed.tech/tags/python.md>), [rust](<https://devfeed.tech/tags/rust.md>), [snowflake](<https://devfeed.tech/tags/snowflake.md>)

### AI overview

Snowflake Connector for Python 5.0.0 adds `snowflake.connector.aio`, an awaitable API for Python 3.11+ built on the same Rust Universal Core as the existing synchronous connector. Async applications can await connection, query, fetch, transaction, Arrow, and pandas operations, keeping the event loop free while Snowflake work waits on the network; independent queries can run concurrently on separate cursors, though warehouse capacity and queuing still affect total time. The synchronous API remains available for scripts and ordinary functions, and both APIs share the implementation. Version 5.0.0 also adds pandas results for JSON responses; Core Arrow conversion is opt-in and in public preview. The excerpt recommends checking the upgrade guide and comparing results, types, and errors when moving from 4.x.

### Source excerpt

Version 5.0.0 is the same package you already install, now with an awaitable API built on Universal Core. If your Python service runs on an event loop, calling Snowflake has meant handing the call to a thread pool so it doesn't block everything else. In our public preview post we introduced Universal Core; this is the Python feature it made room for. Snowflake Connector for Python 5.0.0 became generally available on October 15. It is still snowflake-connector-python, with the same synchronous API. Check the upgrade guide for behavior changes before switching. The package is a thin Python wrapper around Universal Core, the Rust core shared with the ODBC driver. The big addition is snowflake.connector.aio: native asyncio support, the feature you've asked us for most, going back to a 2017 GitHub issue. TL;DR If you run async Python against Snowflake, install snowflake-connector-python 5.0.0 on Python 3.11 or later. Async applications import snowflake.connector.aio and await the calls that talk to Snowflake: connect, execute, fetch, transactions, Arrow, and pandas. One event loop can now hold many Snowflake queries in flight next to the rest of your I/O, with no thread pool around the connector. Asyncio benefits Most of what an application does with Snowflake is wait. It sends SQL, the warehouse runs it, and the result comes back over HTTPS. Asyncio is built for that: while one coroutine waits on the network, the event loop runs the others. With a native async connector, your application can await Snowflake calls directly, without moving them onto a worker thread. Web services and APIs. Applications built with FastAPI and other async frameworks can now query Snowflake without blocking the server while they wait for results. Snowflake SQLAlchemy supports SQLAlchemy's asyncio extension on this connector, so an AsyncSession can run those queries directly. Fan-out queries. A dashboard tile, a data-quality check, or a metadata crawl often runs a few dozen small, independent

## Domain Events Are Easy. Until One Fails Silently.

DevFeed: [Domain Events Are Easy. Until One Fails Silently.](<https://devfeed.tech/articles/domain-events-are-easy-until-one-fails-silently-95407.md>)

Original publisher: [Read original article](<https://thetshaped.dev/p/domain-events-production-failures-nodejs-typescript>)

Author: The T-Shaped Dev

Published: 2026-10-22T12:09:33Z

Content type: tutorial

Language: en

Sources: [The T-Shaped Dev](<https://devfeed.tech/sources/the-t-shaped-dev.md>)

Topics: [event driven](<https://devfeed.tech/topics/event-driven.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>), [await](<https://devfeed.tech/topics/await.md>)

Tags: [3](<https://devfeed.tech/tags/3.md>), [about](<https://devfeed.tech/tags/about.md>), [accounting](<https://devfeed.tech/tags/accounting.md>), [agents](<https://devfeed.tech/tags/agents.md>), [aggregate](<https://devfeed.tech/tags/aggregate.md>), [alert](<https://devfeed.tech/tags/alert.md>), [all](<https://devfeed.tech/tags/all.md>), [also](<https://devfeed.tech/tags/also.md>), [analytics](<https://devfeed.tech/tags/analytics.md>), [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [async](<https://devfeed.tech/tags/async.md>), [bus](<https://devfeed.tech/tags/bus.md>), [domain](<https://devfeed.tech/tags/domain.md>), [event](<https://devfeed.tech/tags/event.md>), [events](<https://devfeed.tech/tags/events.md>), [node](<https://devfeed.tech/tags/node.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [production](<https://devfeed.tech/tags/production.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

Domain events move independent side effects out of a core operation, but an in-process Node.js event bus does not make delivery durable or isolate runtime latency. Use an async bus that awaits handlers and logs rejected results from `Promise.allSettled`; otherwise failures can disappear, and plain `EventEmitter` does not await async handlers. Buffer events during a database transaction and emit only after commit to avoid announcing rolled-back changes. To survive a crash after commit, save an outbox row or job in the same transaction and relay it separately; make handlers safe to rerun using an event ID. Awaiting handlers adds their latency to the request, while fire-and-forget widens the crash window and may not finish on serverless. Events fit when one business fact fans out to growing independent side effects; keep essential work such as seat reservation in the transaction. The excerpt refers to an outbox follow-up for further details.

### Source excerpt

Every tutorial stops at the typed event bus. Here are the 3 production failures it skips, and the fix for each in Node.js.

## Async does not mean parallel, and confusing them costs you a thread pool

DevFeed: [Async does not mean parallel, and confusing them costs you a thread pool](<https://devfeed.tech/articles/async-does-not-mean-parallel-and-confusing-them-costs-you-a-thread-pool-58423.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/57-async-does-not-mean-parallel/>)

Author: hello@ankit-rana.com

Published: 2026-09-23T00:00:00Z

Content type: article

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [Python](<https://devfeed.tech/topics/python.md>), [await](<https://devfeed.tech/topics/await.md>), [Process](<https://devfeed.tech/topics/process.md>), [cpu](<https://devfeed.tech/topics/cpu.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [event-loop](<https://devfeed.tech/tags/event-loop.md>), [nodejs](<https://devfeed.tech/tags/nodejs.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [performance](<https://devfeed.tech/tags/performance.md>), [process](<https://devfeed.tech/tags/process.md>), [python](<https://devfeed.tech/tags/python.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

This article explains that asynchronous programming enables concurrency by interleaving tasks during waits, but does not make CPU-bound work parallel. In a single-threaded Python event loop, a computation-heavy handler can block every other request and increase latency. The article recommends moving CPU work to another process when genuine parallel execution is needed, while noting the cost of copying arguments and results.

### Source excerpt

Async is about not blocking while waiting for something else, and parallel is about doing two things at the same instant on different cores. An event loop achieves enormous concurrency with one thread because most request time is spent waiting on I/O, and that same design collapses the moment a handler does real computation, because nothing else runs until it finishes. Marking CPU bound work async does not make it faster and usually makes latency worse by moving it onto a thread other work depends on.

## Fixing Top-Level Await in Safari

DevFeed: [Fixing Top-Level Await in Safari](<https://devfeed.tech/articles/fixing-top-level-await-in-safari-49196.md>)

Original publisher: [Read original article](<https://webkit.org/blog/18227/fixing-top-level-await-in-safari/>)

Author: Kai Tamkun

Published: 2026-09-02T17:05:29Z

Content type: release

Language: en

Sources: [WebKit](<https://devfeed.tech/sources/webkit.md>)

Topics: [await](<https://devfeed.tech/topics/await.md>), [WebKit](<https://devfeed.tech/topics/webkit.md>), [ECMAScript](<https://devfeed.tech/topics/ecmascript.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [browser](<https://devfeed.tech/topics/browser.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [async](<https://devfeed.tech/topics/async.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Sequences](<https://devfeed.tech/topics/sequences.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [browsers](<https://devfeed.tech/tags/browsers.md>), [bun](<https://devfeed.tech/tags/bun.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [es](<https://devfeed.tech/tags/es.md>), [execution](<https://devfeed.tech/tags/execution.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [js](<https://devfeed.tech/tags/js.md>), [module](<https://devfeed.tech/tags/module.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [webkit](<https://devfeed.tech/tags/webkit.md>)

### AI overview

WebKit for Safari 27 adds full specification compliance for top-level await. The article explains how the feature suspends dependent ES modules while allowing unrelated modules to execute concurrently, and describes the rebuilt module loader behind the change.

### Source excerpt

WebKit for Safari 27 adds full spec compliance for top-level `await`.

## Why Await? Futures in Dart & Flutter

DevFeed: [Why Await? Futures in Dart & Flutter](<https://devfeed.tech/articles/why-await-futures-in-dart-flutter-23990.md>)

Original publisher: [Read original article](<https://quickbirdstudios.com/blog/futures-flutter-dart/>)

Author: Marvin März

Published: 2025-05-27T08:28:16Z

Content type: article

Language: en

Sources: [QuickBird Studios Blog](<https://devfeed.tech/sources/quickbird-studios-blog.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>), [await](<https://devfeed.tech/topics/await.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [dart](<https://devfeed.tech/tags/dart.md>), [event-loop](<https://devfeed.tech/tags/event-loop.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [futures](<https://devfeed.tech/tags/futures.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [object](<https://devfeed.tech/tags/object.md>), [post](<https://devfeed.tech/tags/post.md>), [single-threaded](<https://devfeed.tech/tags/single-threaded.md>)

### AI overview

Dart typically handles concurrent I/O with asynchronous Futures on a single-threaded event loop, avoiding the overhead and complexity of managing many threads. The excerpt explains that blocking work on that thread can stall UI rendering, input handling, and Dart logic. A Future is described as a placeholder for a value or error that will arrive later; Dart also supports Isolates for true parallelism on CPU-intensive tasks. The supplied text ends partway through its explanation, so it does not provide the promised details about Futures' inner workings or common pitfalls.

### Source excerpt

Futures in Dart might seem straightforward at first glance, but dig a little deeper, and you'll find they can be more intricate than you initially thought. Ever wondered how these asynchronous operations truly play with Dart's single-threaded event loop? Or perhaps you've stumbled upon some of the common pitfalls that can trip up even experienced Flutter developers? Fear not, because we're about to embark on a journey to unravel the mysteries of Futures in Dart and Flutter. The post Why Await? Futures in Dart & Flutter appeared first on QuickBird Studios.

## Community threads: Is it possible to create an event-based Workflow?

DevFeed: [Community threads: Is it possible to create an event-based Workflow?](<https://devfeed.tech/articles/community-threads-is-it-possible-to-create-an-event-based-workflow-35759.md>)

Original publisher: [Read original article](<https://temporal.io/blog/community-threads-is-it-possible-to-create-an-event-based-workflow>)

Author: Eric O'Rear

Published: 2023-11-27T05:00:00Z

Content type: tutorial

Language: en

Sources: [Temporal](<https://devfeed.tech/sources/temporal-blog.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [await](<https://devfeed.tech/topics/await.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [async](<https://devfeed.tech/tags/async.md>), [community](<https://devfeed.tech/tags/community.md>), [core](<https://devfeed.tech/tags/core.md>), [python](<https://devfeed.tech/tags/python.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

### AI overview

This Community Threads article explains how to create event-based Workflows in Temporal. It describes using Signals, Awaitables, variables, and wait conditions, with a Python example for asynchronous Activities.

### Source excerpt

Handling event-based signals is one of the core components of Temporal Workflows. In this Community Threads post, a new Temporal user asks: "How do I create an event-based Workflow with Temporal?"

## Kotlin Coroutines Best Practices

DevFeed: [Kotlin Coroutines Best Practices](<https://devfeed.tech/articles/best-practices-39232.md>)

Original publisher: [Read original article](<https://kt.academy/article/cc-best-practices>)

Published: 2023-04-24T00:00:00Z

Content type: article

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [async](<https://devfeed.tech/topics/async.md>), [await](<https://devfeed.tech/topics/await.md>), [Android](<https://devfeed.tech/topics/android.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [backend](<https://devfeed.tech/tags/backend.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A concise review of Kotlin coroutine practices, including avoiding unnecessary async/await usage, preferring awaitAll in suitable cases, keeping suspending functions safe across threads, selecting appropriate dispatchers, injecting dispatchers for unit testing, and using yield in CPU-intensive or blocking work.

### Source excerpt

Let's review the Kotlin Coroutines best practices.

## Reasoning about asyncio.Semaphore

DevFeed: [Reasoning about asyncio.Semaphore](<https://devfeed.tech/articles/reasoning-about-asyncio-semaphore-38903.md>)

Original publisher: [Read original article](<http://neopythonic.blogspot.com/2022/10/reasoning-about-asynciosemaphore.html>)

Author: Guido van Rossum (noreply@blogger.com)

Published: 2022-10-05T06:39:00Z

Content type: article

Language: en

Sources: [Guido van Rossum](<https://devfeed.tech/sources/guido-van-rossum.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [await](<https://devfeed.tech/topics/await.md>)

Tags: [await](<https://devfeed.tech/tags/await.md>), [fairness](<https://devfeed.tech/tags/fairness.md>), [implementing](<https://devfeed.tech/tags/implementing.md>), [performance](<https://devfeed.tech/tags/performance.md>), [reasoning](<https://devfeed.tech/tags/reasoning.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

The article explains asyncio synchronization primitives through a restaurant queuing analogy. It maps exclusive access and cancellation to a Lock, then explains why multiple concurrently seated guests require a Semaphore. It also discusses challenges involving fairness, correctness, semantics, and performance.

### Source excerpt

In Silicon Valley is a very exclusive fast-food restaurant, which is always open. There is one table, where one guest at a time is served an absolutely fabulous hamburger. When you arrive, you wait in line until the table is available. Then the host takes you to the table and, this being America, you are asked a seemingly endless series of questions about how you would like your hamburger to be cooked and served. But today we're not talking about culinary delights. We're talking about the queuing system used by the restaurant. If you are lucky to arrive at the restaurant when the table is available and there are no other guests waiting, you are seated right away. Otherwise, the host gives you a buzzer (from an infinite stack of buzzers!) and you are free to roam the neighborhood until your buzzer goes off. It is the host's job to ensure that guests are seated in order of arrival. When it is your turn, the host will cause your buzzer go off and you make your way back to the restaurant, where you will be seated. If you change your mind, you can return the buzzer to the host, who will take it back without lifting an eyebrow. If your buzzer has already gone off, the host will buzz the next guest, if any. Guests are always polite and don't abscond with their buzzers. The host is always fair and doesn't seat another guest ahead of you even if you take your time making it back. The above description fits that of a Lock. A guest arriving corresponds to the acquire() call; leaving is a release() call. Changing your mind is like getting cancelled while waiting in acquire(). You can change your mind before or after your buzzer goes off, i.e., you can be cancelled before or after the lock has awakened your call (but before you return from acquire()). One day the restaurant expands, hiring extra sous-chefs and opening several new tables. There is still only one host, whose job is not really changed. However, since multiple guests can be seated concurrently, a Semaphore must now

## About async functions

DevFeed: [About async functions](<https://devfeed.tech/articles/about-async-functions-48172.md>)

Original publisher: [Read original article](<https://tkdodo.eu/blog/about-async-functions>)

Published: 2021-07-23T00:00:00Z

Content type: article

Language: en

Sources: [TkDodo](<https://devfeed.tech/sources/tkdodo-s-blog.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [await](<https://devfeed.tech/topics/await.md>), [fetch](<https://devfeed.tech/topics/fetch.md>), [axios](<https://devfeed.tech/topics/axios.md>), [Scala](<https://devfeed.tech/topics/scala.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [axios](<https://devfeed.tech/tags/axios.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [javascript](<https://devfeed.tech/tags/javascript.md>)

### AI overview

A deep dive into JavaScript async functions, explaining how async/await relates to promise chaining, why async functions always return promises, and how this affects control flow and error handling.

### Source excerpt

A deep dive into async functions and how they are different from promise chaining

## The 5 Big Features of TypeScript 3.7 and How to Use Them

DevFeed: [The 5 Big Features of TypeScript 3.7 and How to Use Them](<https://devfeed.tech/articles/the-5-big-features-of-typescript-3-7-and-how-to-use-them-19035.md>)

Original publisher: [Read original article](<https://httptoolkit.com/blog/5-big-features-of-typescript-3.7/>)

Author: HTTP Toolkit; Tim Perry

Published: 2019-09-12T12:00:00Z

Content type: article

Language: en

Sources: [HTTP Toolkit](<https://devfeed.tech/sources/http-toolkit.md>)

Topics: [TypeScript](<https://devfeed.tech/topics/typescript.md>), [data type](<https://devfeed.tech/topics/data-type.md>), [await](<https://devfeed.tech/topics/await.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [feature](<https://devfeed.tech/tags/feature.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

The excerpt explains how TypeScript 3.7 assert signatures let a function narrow an argument's type as a side effect: after an assertion function returns, TypeScript can treat the value as the asserted type. For this to be safe, a failed assertion must throw or otherwise never return. The article also introduces top-level await as a way to use async/await at the top level, noting its relevance to runnable scripts and TypeScript REPLs; the excerpt ends before explaining further. Recursive type aliases, null coalescing and optional chaining are listed as release features but not covered in the supplied text.

### Source excerpt

The TypeScript 3.7 release is coming soon, and it's going to be a big one. The target release date is November 5th, and there's some seriously exciting headline features included: Assert signatures Recursive type aliases Top-level await Null coalescing Optional chaining Personally, I'm super excited about this, they're going to whisk away all sorts of annoyances that I've been fighting in TypeScript whilst building HTTP Toolkit. If you haven't been paying close attention to the TypeScript development process though, it's probably not clear what half of these mean, or why you should care. Let's talk them through. Assert Signatures This is a brand-new & little-known TypeScript feature, which allows you to write functions that act like type guards as a side-effect, rather than explicitly returning their boolean result. It's easiest to demonstrate this with a JavaScript example: // In JS: function assertString(input) { if (typeof input === 'string') return; else throw new Error('Input must be a string!'); } function doSomething(input) { assertString(input); // ... Use input, confident that it's a string } doSomething('abc'); // All good doSomething(123); // Throws an error This pattern is neat and useful and you can't use it in TypeScript today. TypeScript can't know that you've guaranteed the type of input after it's run assertString. Typically people just make the argument input: string to avoid this, and that's good, but that also just pushes the type checking problem somewhere else, and in cases where you just want to fail hard it's useful to have this option available. Fortunately, soon we will: // With TS 3.7 function assertString(input: any): asserts input is string { // <-- the magic if (typeof input === 'string') return; else throw new Error('Input must be a string!'); } function doSomething(input: string | number) { assertString(input); // input's type is just 'string' here } Here assert input is string means that if this function ever returns, TypeScript can

## A dive into Async-Await on Android

DevFeed: [A dive into Async-Await on Android](<https://devfeed.tech/articles/a-dive-into-async-await-on-android-25997.md>)

Original publisher: [Read original article](<https://medium.com/@nhaarman/a-dive-into-async-await-on-android-5a6699029aa3?source=rss-fceb7a60a849------2>)

Author: Niek Haarman

Published: 2016-11-03T16:09:29Z

Content type: article

Language: en

Sources: [Niek Haarman](<https://devfeed.tech/sources/stories-by-niek-haarman-on-medium.md>)

Topics: [await](<https://devfeed.tech/topics/await.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [async](<https://devfeed.tech/topics/async.md>), [callback](<https://devfeed.tech/topics/callback.md>), [Android](<https://devfeed.tech/topics/android.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [background](<https://devfeed.tech/tags/background.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [callback](<https://devfeed.tech/tags/callback.md>), [database](<https://devfeed.tech/tags/database.md>), [imperative](<https://devfeed.tech/tags/imperative.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [network](<https://devfeed.tech/tags/network.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

The excerpt explains how async-await can replace nested callbacks when coordinating long-running operations on Android. Its example chains three network requests and updates a TextView on the main thread without blocking the UI. In the preview API described, `asyncUI` enables suspension and changes how method results are handled; execution proceeds synchronously until `await` reaches a suspension point. `await` registers for completion of an asynchronous operation, returns, then resumes the method with its result. The article stresses that `asyncUI` itself does not move code to a background thread. These details are from a preview version and have since changed.

### Source excerpt

Note: this article was written for a preview version of coroutines for Kotlin. Its details have changed since then. In a previous article I provided a glimpse into the world of async-await on Android. Now it's time to dive a little bit deeper in this upcoming functionality in Kotlin 1.1 What is async-await for? When dealing with long-running operations like network calls or database transactions, you need to make sure you schedule this work to a background thread. If you forget to do this, you may end up with blocking the UI thread until the task is finished. During that time, the user cannot interact with your application. Unfortunately when you schedule a new task in the background, you cannot use its result directly. Instead, you're gonna have to use some sort of callback. When that callback is invoked with the result of the operation, you can continue with what you want to do, for example run another network request. This easily flows in what people call a 'callback hell': multiple nested callbacks, all waiting to be invoked when some long-running task has finished. fun retrieveIssues() { githubApi.retrieveUser() { user -> githubApi.repositoriesFor(user) { repositories -> githubApi.issueFor(repositories.first()) { issues -> handler.post { textView.text = "You have issues!" } } } } } This snippet of code does three network requests, and finally posts a message to the main thread to update the text of some TextView. Fixing this with async-await With async-await, you can program that same function in a more imperative way. Instead of passing a callback to the function, you can call a suspension function await which lets you use the result of the task in a way that resembles normal synchronous code: fun retrieveIssues() = asyncUI { val user = await(githubApi.retrieveUser()) val repositories = await(githubApi.repositoriesFor(user)) val issues = await(githubApi.issueFor(repositories.first())) textView.text = "You have issues!" } This snippet of code still does three n