# 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.

## 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 Blog](<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>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.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>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.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