# async/await

A JavaScript syntax mechanism that simplifies consuming promise-based asynchronous APIs.

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

## CodeSOD: Asynchronous Directories

DevFeed: [CodeSOD: Asynchronous Directories](<https://devfeed.tech/articles/codesod-asynchronous-directories-28505.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/asynchronous-directories>)

Author: Remy Porter

Published: 2026-09-09T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Vala](<https://devfeed.tech/topics/vala.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Library](<https://devfeed.tech/topics/library.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [writing-code](<https://devfeed.tech/tags/writing-code.md>)

### AI overview

This article examines implementing an asynchronous version of Vala's directory-creation method when the core library provides only a synchronous version. The proposed function walks up the directory tree, then creates missing directories in reverse order, using exceptions for control flow.

### Source excerpt

Eri has a mix of a "true confession" and a "wait, really?" today. The programming language Vala bills itself as a C# like language that compiles into something pretty close to C performance, designed specifically for writing code against Gnome and its associated libraries. One of the C#-isms in brings in is async/await type semantics. You can yield someAsyncFunction(), which returns control to the caller, allowing it to proceed until the yielded function returns an actual value. Because it has asynchronous functions, many library functions for handling I/O are already async. So you can make_directory_async, which yields control so you can keep executing while waiting for the filesystem to make your directory. There are also synchronous versions of those methods. And then there's create_directory_with_parents, which will create a chain of directories for you. That's the synchronous version, and Vala's core library has decided not to provide an asynchronous version of it, which is my "wait, really?" I suspect it's really about the race conditions involved and the risks of things going wrong while doing it asynchronously; all solvable problems, but tricky ones to solve. But it's the problem Eri had, and this is their solution: /// Note: does not throw if target already exists async void create_directory_with_parents_async(File file, Cancellable? cancellable = null) throws Error { var to_create = new File[0]; var? current_target = file; while(current_target != null) { try { yield current_target.make_directory_async(Priority.DEFAULT, cancellable); } catch(IOError.NOT_FOUND e) { to_create += current_target; current_target = current_target.get_parent(); continue; } catch(IOError.EXISTS e) { break; } break; } for (int i = to_create.length - 1; i >= 0; --i) { try { yield to_create[i].make_directory_async(Priority.DEFAULT, cancellable); } catch(IOError.EXISTS e) { // Created by another process } } } If I'm reading this correctly, we start by trying to create the full path to

## Defer in Swift explained with Code Examples

DevFeed: [Defer in Swift explained with Code Examples](<https://devfeed.tech/articles/defer-in-swift-explained-with-code-examples-11485.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swift/defer-usage-swift/>)

Author: Antoine van der Lee

Published: 2026-07-06T12:51:59Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Code](<https://devfeed.tech/topics/code.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [defer](<https://devfeed.tech/tags/defer.md>), [examples](<https://devfeed.tech/tags/examples.md>), [leaving](<https://devfeed.tech/tags/leaving.md>), [scope](<https://devfeed.tech/tags/scope.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial explains Swift's defer statement, which runs code when control leaves its scope. It covers reverse execution order for multiple defer statements, using defer for resource cleanup, and Swift 6.4 support for awaiting asynchronous cleanup in defer bodies.

### Source excerpt

Although the defer keyword was already introduced in Swift 2.0, it's still quite uncommon to use it in projects. Its usage can be hard to understand, but using it can improve your code a lot in some places. The most common use case seen around is opening and closing a context within a scope. Starting ... -> The post Defer in Swift explained with Code Examples appeared first on SwiftLee.

## Use Swift with Temporal

DevFeed: [Use Swift with Temporal](<https://devfeed.tech/articles/use-swift-with-temporal-36022.md>)

Original publisher: [Read original article](<https://temporal.io/blog/temporal-now-supports-swift>)

Author: Shy Ruparel

Published: 2025-11-10T00:00:00Z

Content type: release

Language: en

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

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Swift 6.2](<https://devfeed.tech/topics/swift-6-2.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [distributed-systems](<https://devfeed.tech/topics/distributed-systems.md>)

Tags: [announcements](<https://devfeed.tech/tags/announcements.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [github](<https://devfeed.tech/tags/github.md>), [grpc](<https://devfeed.tech/tags/grpc.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swift-6-2](<https://devfeed.tech/tags/swift-6-2.md>)

### AI overview

Temporal announces a Swift SDK for building durable, fault-tolerant, long-running workflows with Swift 6.2, async/await, and structured concurrency. The SDK supports automatic handling of failures, retries, persistence, and crash recovery, and integrates with Temporal through Swift C interop and gRPC-swift.

### Source excerpt

Announcing the Swift Temporal SDK. Build durable, fault-tolerant Workflows in Swift 6.2 with async/await and structured concurrency.

## Promise based Web Worker Messaging

DevFeed: [Promise based Web Worker Messaging](<https://devfeed.tech/articles/promise-based-web-worker-messaging-37370.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/web-workers-promises/>)

Author: Stanko

Published: 2025-11-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [Promise](<https://devfeed.tech/topics/promise.md>), [Messaging](<https://devfeed.tech/topics/messaging.md>), [Web](<https://devfeed.tech/topics/web.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Code](<https://devfeed.tech/topics/code.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [code](<https://devfeed.tech/tags/code.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [event](<https://devfeed.tech/tags/event.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [messaging](<https://devfeed.tech/tags/messaging.md>), [thread](<https://devfeed.tech/tags/thread.md>), [web](<https://devfeed.tech/tags/web.md>), [worker](<https://devfeed.tech/tags/worker.md>)

### AI overview

This tutorial presents a Promise-based wrapper for Web Worker messaging. It explains how unique message identifiers map worker responses to stored promises, allowing the main thread to resolve or reject the corresponding promise and use async/await with simpler error handling. The same pattern can also be applied to Service Workers.

### Source excerpt

If you've ever used Web Workers (or any other event-based communication), you probably noticed that this kind of code can be hard to read and reason about. You also have to implement some kind of identifier for each message to recognize which worker response corresponds to which request. To simplify that, we can write a small wrapper that lets us use Promises to communicate with Workers. I'll show you an example for Web Workers, but the same pattern can be applied to Service Workers as well. The resulting API looks like this: const workerResponse = await sendToWorker(data); I first used this approach in Pulsar, because I wanted to parse and execute the user's code in a Web Worker, but also wait for the worker to finish before providing data for the next frame. Implementation # The idea is fairly simple - before sending a message to the worker, we create a unique id and a promise. We store the promise in a map using the id as the key. Then we send an event to the worker, including both the data and the id, and return the promise to the caller. When the worker finishes its calculation, it sends back a message that includes the result and the same id. In the main thread, we listen for these messages. When one arrives, we use the id to find the corresponding promise in our map. Finally, based on the worker's result, we resolve or reject that promise. It might sound like a lot, but the code is actually quite straightforward: send-to-worker.jsCopy // Worker initialization const worker = new Worker("./path-to-your-worker.js"); // Map of promises const promises = {}; worker.addEventListener("message", (e) => { // Listen to worker messages and find the correct promise matching the id // Then resolve or reject it depending on the response if (e.data.error) { promises[e.data.id].reject(e.data.error); } else { promises[e.data.id].resolve(e.data.data); } // Remove the resolver reference delete promises[e.data.id]; }); // For identifiers it is safe to use a simple integer // whic

## Kotlin Coroutines Compared with Reactor for Sequential and Asynchronous Operations

DevFeed: [Kotlin Coroutines Compared with Reactor for Sequential and Asynchronous Operations](<https://devfeed.tech/articles/coroutines-vs-reactor-when-elegance-and-simplicity-crush-complexity-39263.md>)

Original publisher: [Read original article](<https://kt.academy/article/coroutines-vs-reactor>)

Published: 2025-10-06T00:00:00Z

Content type: comparison

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>), [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Android](<https://devfeed.tech/topics/android.md>), [Back end](<https://devfeed.tech/topics/backend.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [backend](<https://devfeed.tech/tags/backend.md>), [compare](<https://devfeed.tech/tags/compare.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [simple](<https://devfeed.tech/tags/simple.md>), [time](<https://devfeed.tech/tags/time.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article compares Kotlin Coroutines with Reactor for backend and Android development. It argues that coroutines provide more readable and straightforward syntax for sequential and asynchronous operations, while Reactor requires additional operators, concepts, and patterns.

### Source excerpt

A comparison of Kotlin Coroutines and Reactor, highlighting the elegance and simplicity of Coroutines over the complexity of Reactor.

## Kotlin Coroutines and Swift

DevFeed: [Kotlin Coroutines and Swift](<https://devfeed.tech/articles/kotlin-coroutines-and-swift-39324.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-coroutines-swift>)

Published: 2025-09-15T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Structured concurrency](<https://devfeed.tech/topics/structured-concurrency.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [swift](<https://devfeed.tech/tags/swift.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how to bridge Kotlin Coroutines and Swift's async/await and structured concurrency in Kotlin Multiplatform iOS projects. It covers suspending functions, exception conversion, Kotlin Flow to AsyncSequence, and calling Swift async functions from Kotlin.

### Source excerpt

How to use Kotlin Coroutines in Swift projects, or Swift libraries from Kotlin Coroutines.

## Укрощаем асинхронный код с помощью async/await

DevFeed: [Укрощаем асинхронный код с помощью async/await](<https://devfeed.tech/articles/async-await-30683.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/hh/articles/904506/>)

Author: McDee (hh.ru)

Published: 2025-04-29T06:50:38Z

Content type: tutorial

Language: ru

Sources: [HeadHunter RU](<https://devfeed.tech/sources/headhunter-ru.md>)

Topics: [async/await](<https://devfeed.tech/topics/async-await.md>), [async](<https://devfeed.tech/topics/async.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Swift](<https://devfeed.tech/topics/swift.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [ios](<https://devfeed.tech/tags/ios.md>), [ios-92ecabba3495](<https://devfeed.tech/tags/ios-92ecabba3495.md>), [ios-development](<https://devfeed.tech/tags/ios-development.md>), [swift](<https://devfeed.tech/tags/swift.md>), [tag-218f4e01a540](<https://devfeed.tech/tags/tag-218f4e01a540.md>), [tag-7b7ea8dda2d4](<https://devfeed.tech/tags/tag-7b7ea8dda2d4.md>), [tag-ae979152fd5d](<https://devfeed.tech/tags/tag-ae979152fd5d.md>), [tag-f538878e20ff](<https://devfeed.tech/tags/tag-f538878e20ff.md>)

### AI overview

This Russian-language tutorial explains async/await for asynchronous and multithreaded programming in iOS applications with Swift. It introduces the core concepts and compares async/await with GCD, highlighting code readability and error handling.

### Source excerpt

Привет! Меня зовут Андрей Максимкин, я iOS-разработчик в hh. Мы в команде активно используем async/await подход при написании нового кода, а также активно применяем при переписывании старого. В процессе работы сталкивались с некоторыми интересными и не самыми очевидными моментами -- их и рассмотрим в статье. Работа с различными потоками -- очень важная часть разработки мобильных приложений под iOS. Грамотное распределение нагрузки положительно влияет на скорость работы приложения, а значит, и на пользовательский опыт. До Swift 5.5 для работы с многопоточностью в основном использовали фреймворки GCD и NSOperation. Начиная с версии Swift 5.5 стал доступен функционал async/await. В статье мы кратко расскажем о базовых принципах данного подхода и сделаем акцент на проблемах и особенностях, которые необходимо знать при написании кода. Информация будет полезна тем, кто уже знаком с функционалом async/await, а некоторые примеры могут быть интересны и более продвинутым разработчикам. Поехали!

## Key advantages of Kotlin Coroutines

DevFeed: [Key advantages of Kotlin Coroutines](<https://devfeed.tech/articles/key-advantages-of-kotlin-coroutines-39257.md>)

Original publisher: [Read original article](<https://kt.academy/article/coroutines-advantages>)

Published: 2024-06-10T00: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>), [Structured concurrency](<https://devfeed.tech/topics/structured-concurrency.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [cancellation](<https://devfeed.tech/topics/cancellation.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Ktor](<https://devfeed.tech/topics/ktor.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Android](<https://devfeed.tech/topics/android.md>), [WebSocket](<https://devfeed.tech/topics/websocket.md>)

Tags: [cancellation](<https://devfeed.tech/tags/cancellation.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [http](<https://devfeed.tech/tags/http.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [testing](<https://devfeed.tech/tags/testing.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains the main advantages of Kotlin Coroutines: simpler imperative-style asynchronous code, structured concurrency, lighter execution than threads, cancellation, synchronization, and precise virtual-time testing. It discusses applications in Android and backend development, including Ktor.

### Source excerpt

Where Kotlin Coroutines shine and why you should use them.

## Fastify plugins as building blocks for a backend Node.js API

DevFeed: [Fastify plugins as building blocks for a backend Node.js API](<https://devfeed.tech/articles/fastify-plugins-as-building-blocks-for-a-backend-node-js-api-7915.md>)

Original publisher: [Read original article](<https://snyk.io/blog/fastify-plugins-for-backend-node-js-api/>)

Author: Liran Tal

Published: 2024-05-28T05:00:00Z

Content type: article

Language: en

Sources: [Blog RSS Feed | Snyk](<https://devfeed.tech/sources/blog-rss-feed-snyk.md>)

Topics: [Fastify](<https://devfeed.tech/topics/fastify.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [API](<https://devfeed.tech/topics/api.md>), [Application Development](<https://devfeed.tech/topics/application-development.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [Routing (disambiguation)](<https://devfeed.tech/topics/routing.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [application-security](<https://devfeed.tech/tags/application-security.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [awareness](<https://devfeed.tech/tags/awareness.md>), [backend](<https://devfeed.tech/tags/backend.md>), [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [code](<https://devfeed.tech/tags/code.md>), [developer](<https://devfeed.tech/tags/developer.md>), [devrel](<https://devfeed.tech/tags/devrel.md>), [ecosystem](<https://devfeed.tech/tags/ecosystem.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [node](<https://devfeed.tech/tags/node.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [performance](<https://devfeed.tech/tags/performance.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [routing](<https://devfeed.tech/tags/routing.md>), [snyk-code](<https://devfeed.tech/tags/snyk-code.md>), [snyk-open-source](<https://devfeed.tech/tags/snyk-open-source.md>), [speed](<https://devfeed.tech/tags/speed.md>), [web](<https://devfeed.tech/tags/web.md>), [web-applications](<https://devfeed.tech/tags/web-applications.md>), [web-development](<https://devfeed.tech/tags/web-development.md>)

### AI overview

This article presents Fastify and its plugin ecosystem as building blocks for backend Node.js APIs. It discusses Fastify's low overhead, performance-oriented architecture, open source community, native ECMAScript module support, async/await route definitions, promise-based asynchronous code, and radix-tree routing for efficient request handling.

### Source excerpt

This blog post will focus on the foundational building blocks of building backend Node.js APIs using Fastify and its recommended plugins in 2024.

## Oxidizing OCaml: Data Race Freedom

DevFeed: [Oxidizing OCaml: Data Race Freedom](<https://devfeed.tech/articles/oxidizing-ocaml-data-race-freedom-20202.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/oxidizing-ocaml-parallelism/>)

Author: Max Slater

Published: 2023-09-01T00:00:00Z

Content type: article

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [OCaml](<https://devfeed.tech/topics/ocaml.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [data](<https://devfeed.tech/topics/data.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [await](<https://devfeed.tech/tags/await.md>), [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [data](<https://devfeed.tech/tags/data.md>), [ocaml](<https://devfeed.tech/tags/ocaml.md>), [rust](<https://devfeed.tech/tags/rust.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

This final post in a series explains how Jane Street uses OCaml modes and capsules to design a statically data-race-free API for multicore OCaml. It discusses shared-memory parallelism, the risks of mutable data races, and approaches for safely handling shared mutability across domains.

### Source excerpt

OCaml with Jane Street extensions is available from our public opam repo. Only a slice of the features described in this series are currently implemented.

## Async / Await Coroutines in Swift from Kotlin Multiplatform using KMP-NativeCoroutines

DevFeed: [Async / Await Coroutines in Swift from Kotlin Multiplatform using KMP-NativeCoroutines](<https://devfeed.tech/articles/async-await-coroutines-in-swift-from-kotlin-multiplatform-using-kmp-nativecoroutines-24820.md>)

Original publisher: [Read original article](<https://akjaw.com/async-await-coroutines-in-swift-using-kmp-nativecoroutines/>)

Author: Aleksander Jaworski

Published: 2023-08-02T13:01:12Z

Content type: tutorial

Language: en

Sources: [AKJAW](<https://devfeed.tech/sources/akjaw.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [async/await](<https://devfeed.tech/topics/async-await.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

A write-up of a Droidcon Berlin 2023 talk about calling Kotlin Multiplatform coroutines from Swift using KMP-NativeCoroutines. It states that the official approach has significant awkwardness and limitations.

### Source excerpt

This is a write-up for a talk I gave at Droidcon Berlin 2023, the video version can be found here: Calling Kotlin Multiplatform Coroutines from Swift with the help of KMP-NativeCoroutines - droidcon The official way of using Coroutines from Swift is awkward and has a lot of limitations. These

## Firebase team profile: Charlotte Liang

DevFeed: [Firebase team profile: Charlotte Liang](<https://devfeed.tech/articles/firebaserfriday-charlotte-liang-16493.md>)

Original publisher: [Read original article](<https://firebase.blog/posts/2022/11/meet-firebaser-charlotte>)

Author: Paulette McCroskey

Published: 2022-11-18T00:00:00Z

Content type: article

Language: en

Sources: [Firebase Blog](<https://devfeed.tech/sources/firebase-blog.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [community](<https://devfeed.tech/tags/community.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firebaserfriday](<https://devfeed.tech/tags/firebaserfriday.md>), [google](<https://devfeed.tech/tags/google.md>), [ios](<https://devfeed.tech/tags/ios.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [sdks](<https://devfeed.tech/tags/sdks.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>), [watchos](<https://devfeed.tech/tags/watchos.md>)

### AI overview

A mini-profile of Firebase team member Charlotte Liang covering her path from writing the Firebase Remote Config iOS SDK to modernizing Firebase SDKs with Swift. She also discusses iOS and watchOS app development, SwiftUI, and her preference for async/await over callback listeners.

### Source excerpt

Join us for the monthly mini-profiles on Firebase team members, aka "Firebasers", from all around the world! Learn about their backgrounds...

## React Labs: What We've Been Working On - June 2022

DevFeed: [React Labs: What We've Been Working On - June 2022](<https://devfeed.tech/articles/react-labs-what-we-ve-been-working-on-june-2022-2971.md>)

Original publisher: [Read original article](<https://react.dev/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022>)

Author: Andrew Clark, Dan Abramov, Jan Kassens, Joseph Savona, Josh Story, Lauren Tan, Luna Ruan, Mengdi Chen, Rick Hanlon, Robert Zhang, Sathya Gunasekaran, Sebastian Markbage, and Xuan Huang

Published: 2022-06-15T00:00:00Z

Content type: article

Language: en

Sources: [React Blog](<https://devfeed.tech/sources/react-blog.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Vite](<https://devfeed.tech/topics/vite.md>), [Webpack](<https://devfeed.tech/topics/webpack.md>), [Shopify](<https://devfeed.tech/topics/shopify.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [insights](<https://devfeed.tech/tags/insights.md>), [react](<https://devfeed.tech/tags/react.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [streaming](<https://devfeed.tech/tags/streaming.md>), [vercel](<https://devfeed.tech/tags/vercel.md>), [vite](<https://devfeed.tech/tags/vite.md>), [webpack](<https://devfeed.tech/tags/webpack.md>)

### AI overview

The React team shares research updates following the React 18 release, including work on React Server Components, async/await-based data fetching, boundary annotations, cross-ecosystem bundler semantics, and APIs for coordinating external assets across React environments.

### Source excerpt

React 18 was years in the making, and with it brought valuable lessons for the React team. Its release was the result of many years of research and exploring many paths. Some of those paths were successful; many more were dead-ends that led to new insights. One lesson we've learned is that it's frustrating for the community to wait for new features without having insight into these paths that we're exploring.

## React Labs: What We've Been Working On - June 2022

DevFeed: [React Labs: What We've Been Working On - June 2022](<https://devfeed.tech/articles/react-labs-what-we-ve-been-working-on-june-2022-22348.md>)

Original publisher: [Read original article](<https://reactjs.org/blog/2022/06/15/react-labs-what-we-have-been-working-on-june-2022.html>)

Published: 2022-06-15T00:00:00Z

Content type: article

Language: en

Sources: [React](<https://devfeed.tech/sources/react.md>)

Topics: [React](<https://devfeed.tech/topics/react.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Shopify](<https://devfeed.tech/topics/shopify.md>), [Vercel](<https://devfeed.tech/topics/vercel.md>), [Vite](<https://devfeed.tech/topics/vite.md>), [Webpack](<https://devfeed.tech/topics/webpack.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [compatibility](<https://devfeed.tech/tags/compatibility.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [react](<https://devfeed.tech/tags/react.md>), [release](<https://devfeed.tech/tags/release.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [vercel](<https://devfeed.tech/tags/vercel.md>), [vite](<https://devfeed.tech/tags/vite.md>), [webpack](<https://devfeed.tech/tags/webpack.md>)

### AI overview

A June 2022 React Labs update describes ongoing research following the React 18 release, including experimental React Server Components. The React team discusses adopting async/await, annotating boundaries, coordinating bundler semantics across Webpack and Vite with Vercel and Shopify, and improving asset loading APIs. The projects had no firm timelines and might change or never ship in their current form.

### Source excerpt

This blog site has been archived. Go to react.dev/blog to see the recent posts. React 18 was years in the making, and with it brought valuable lessons for the React team. Its release was the result of many years of research and exploring many paths. Some of those paths were successful; many more were dead-ends that led to new insights. One lesson we've learned is that it's frustrating for the community to wait for new features without having insight into these paths that we're exploring. We typically have a number of projects being worked on at any time, ranging from the more experimental to the clearly defined. Looking ahead, we'd like to start regularly sharing more about what we've been working on with the community across these projects. To set expectations, this is not a roadmap with clear timelines. Many of these projects are under active research and are difficult to put concrete ship dates on. They may possibly never even ship in their current iteration depending on what we learn. Instead, we want to share with you the problem spaces we're actively thinking about, and what we've learned so far. Server Components We announced an experimental demo of React Server Components (RSC) in December 2020. Since then we've been finishing up its dependencies in React 18, and working on changes inspired by experimental feedback. In particular, we're abandoning the idea of having forked I/O libraries (eg react-fetch), and instead adopting an async/await model for better compatibility. This doesn't technically block RSC's release because you can also use routers for data fetching. Another change is that we're also moving away from the file extension approach in favor of annotating boundaries. We're working together with Vercel and Shopify to unify bundler support for shared semantics in both Webpack and Vite. Before launch, we want to make sure that the semantics of RSCs are the same across the whole React ecosystem. This is the major blocker for reaching stable. Asset Loa

## Advanced Swift, fifth edition

DevFeed: [Advanced Swift, fifth edition](<https://devfeed.tech/articles/advanced-swift-fifth-edition-21708.md>)

Original publisher: [Read original article](<https://oleb.net/2022/advanced-swift-5/>)

Author: Ole Begemann

Published: 2022-03-28T14:03:30Z

Content type: release

Language: en

Sources: [Ole Begemann](<https://devfeed.tech/sources/ole-begemann.md>)

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

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [generics](<https://devfeed.tech/tags/generics.md>), [release](<https://devfeed.tech/tags/release.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

The fifth edition of Advanced Swift has been released. It is updated for Swift 5.6, adds a chapter on concurrency covering async/await, structured concurrency, and actors, and includes new material on property wrappers, result builders, protocols, and generics. The print edition is now a hardcover, and ebook owners receive a free update.

### Source excerpt

We released the fifth edition of our book Advanced Swift a few days ago. You can buy the ebook on the objc.io site. The hardcover print edition is printed and sold by Amazon (amazon.com, amazon.co.uk, amazon.de). Highlights of the new edition: Fully updated for Swift 5.6 A new Concurrency chapter covering async/await, structured concurrency, and actors New content on property wrappers, result builders, protocols, and generics The print edition is now a hardcover (for the same price) Free update for owners of the ebook A growing book for a growing language Updating the book always turns out to be more work than I expect. Swift has grown substantially since our last release (for Swift 5.0), and the size of the book reflects this. The fifth edition is 76 % longer than the first edition from 2016. This time, we barely stayed under 1 million characters: Character counts of Advanced Swift editions from 2016-2022. Many thanks to our editor, Natalye, for reading all this and improving our Dutch/German dialect of English. Hardcover For the first time, the print edition comes in hardcover (for the same price). Being able to offer this makes me very happy. The hardcover book looks much better and is more likely to stay open when laid flat on a table. We also increased the page size from 15x23 cm (6x9 in) to 18x25 cm (7x10 in) to keep the page count manageable (Amazon's print on demand service limits hardcover books to 550 pages). I hope you enjoy the new edition. If you decide to buy the book or if you bought it in the past, thank you very much! And if you're willing to write a review on Amazon, we'd appreciate it.

## AppCode 2021.2: улучшения поддержки Swift, автодополнение выражений, окно иерархии вызовов для Swift и не только

DevFeed: [AppCode 2021.2: улучшения поддержки Swift, автодополнение выражений, окно иерархии вызовов для Swift и не только](<https://devfeed.tech/articles/appcode-2021-2-swift-swift-23930.md>)

Original publisher: [Read original article](<https://habr.com/ru/companies/JetBrains/articles/573126/>)

Author: yeswolf (JetBrains)

Published: 2021-08-16T09:53:35Z

Content type: release

Language: ru

Sources: [JetBrains RU](<https://devfeed.tech/sources/jetbrains-ru.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [ide](<https://devfeed.tech/topics/ide.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [swift-package-manager](<https://devfeed.tech/topics/swift-package-manager.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>)

Tags: [appcode](<https://devfeed.tech/tags/appcode.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [call-hierarchy](<https://devfeed.tech/tags/call-hierarchy.md>), [complete-statement](<https://devfeed.tech/tags/complete-statement.md>), [ide](<https://devfeed.tech/tags/ide.md>), [kmm](<https://devfeed.tech/tags/kmm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-multiplatform-mobile](<https://devfeed.tech/tags/kotlin-multiplatform-mobile.md>), [local-history](<https://devfeed.tech/tags/local-history.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swift-package-manager](<https://devfeed.tech/tags/swift-package-manager.md>)

### AI overview

This release article describes AppCode 2021.2 improvements, including support for Swift features such as result builders, enum Codable synthesis, and async/await. It also covers documentation completion, Call Hierarchy, Swift Package Manager build and debugging support, a Kotlin Multiplatform Mobile plugin, a debugger Preview Tab, and Local History search.

### Source excerpt

Привет, Хабр! В этом посте, как и всегда, расскажем о новом релизе AppCode. Всем, кому интересно, -- добро пожаловать под кат. Читать далее

## New runtime configuration options with Cloud Functions for Firebase

DevFeed: [New runtime configuration options with Cloud Functions for Firebase](<https://devfeed.tech/articles/new-runtime-configuration-options-with-cloud-functions-for-firebase-16278.md>)

Original publisher: [Read original article](<https://firebase.blog/posts/2018/08/cloud-functions-for-firebase-config-node-8-timeout-memory-region>)

Author: Doug Stevenson

Published: 2018-08-13T00:00:00Z

Content type: release

Language: en

Sources: [Firebase Blog](<https://devfeed.tech/sources/firebase-blog.md>)

Topics: [Cloud Functions](<https://devfeed.tech/topics/cloud-functions.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [Firebase CLI](<https://devfeed.tech/topics/firebase-cli.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [ECMAScript](<https://devfeed.tech/topics/ecmascript.md>), [V8](<https://devfeed.tech/topics/v8.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [cloud-functions](<https://devfeed.tech/tags/cloud-functions.md>), [cloud-next](<https://devfeed.tech/tags/cloud-next.md>), [deployment](<https://devfeed.tech/tags/deployment.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firebase-cli](<https://devfeed.tech/tags/firebase-cli.md>), [json](<https://devfeed.tech/tags/json.md>), [launch](<https://devfeed.tech/tags/launch.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [serverless](<https://devfeed.tech/tags/serverless.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

This Firebase team article describes new Cloud Functions for Firebase configuration options announced at Cloud Next 2018. It covers the beta Node.js 8 runtime, required Firebase CLI and firebase-functions versions, ECMAScript 2017 async/await support, TypeScript configuration, and per-function region, memory, and timeout settings.

### Source excerpt

News, tutorials, and updates from the Firebase team.

## Javascript's async/await and Promise in a few words

DevFeed: [Javascript's async/await and Promise in a few words](<https://devfeed.tech/articles/javascript-s-async-await-and-promise-in-a-few-words-35422.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/javascripts-async-await-and-promise-in-a-few-words/>)

Author: Graham King

Published: 2018-07-27T14:30:45Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [async/await](<https://devfeed.tech/topics/async-await.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Promise](<https://devfeed.tech/topics/promise.md>), [callback](<https://devfeed.tech/topics/callback.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [callback](<https://devfeed.tech/tags/callback.md>), [exception](<https://devfeed.tech/tags/exception.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [software](<https://devfeed.tech/tags/software.md>)

### AI overview

This tutorial explains how JavaScript uses Promises and async/await to handle operations that could otherwise block its single thread. It shows how async/await makes callback-based asynchronous code appear more linear while failures are handled through exceptions.

### Source excerpt

Unraveling the magic of async/await: From callbacks to linear code.

## Why you should use TypeScript for writing Cloud Functions

DevFeed: [Why you should use TypeScript for writing Cloud Functions](<https://devfeed.tech/articles/why-you-should-use-typescript-for-writing-cloud-functions-16253.md>)

Original publisher: [Read original article](<https://firebase.blog/posts/2018/01/why-you-should-use-typescript-for>)

Author: Doug Stevenson

Published: 2018-01-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Firebase Blog](<https://devfeed.tech/sources/firebase-blog.md>)

Topics: [Cloud Functions](<https://devfeed.tech/topics/cloud-functions.md>), [TypeScript](<https://devfeed.tech/topics/typescript.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [Development](<https://devfeed.tech/topics/development.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [admin-sdk](<https://devfeed.tech/tags/admin-sdk.md>), [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [cloud-functions](<https://devfeed.tech/tags/cloud-functions.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [development](<https://devfeed.tech/tags/development.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firebase-cli](<https://devfeed.tech/tags/firebase-cli.md>), [tutorials](<https://devfeed.tech/tags/tutorials.md>), [typescript](<https://devfeed.tech/tags/typescript.md>)

### AI overview

This Firebase tutorial explains why developers may choose TypeScript for Cloud Functions. It covers TypeScript features such as optional static type checking, classes, interfaces, generics, enums, and async/await, then focuses on using TSLint and the Firebase CLI to check and build code before deployment.

### Source excerpt

News, tutorials, and updates from the Firebase team.

## 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: tutorial

Language: en

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

Topics: [async/await](<https://devfeed.tech/topics/async-await.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Code](<https://devfeed.tech/topics/code.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Network](<https://devfeed.tech/topics/network.md>), [Database](<https://devfeed.tech/topics/database.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>), [blocking](<https://devfeed.tech/tags/blocking.md>), [callback](<https://devfeed.tech/tags/callback.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [database](<https://devfeed.tech/tags/database.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-compiler](<https://devfeed.tech/tags/kotlin-compiler.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [network](<https://devfeed.tech/tags/network.md>), [textview](<https://devfeed.tech/tags/textview.md>)

### AI overview

This tutorial explains async-await on Android using Kotlin coroutines, focusing on handling long-running network and database operations without blocking the UI thread. It contrasts nested callbacks with suspension functions such as asyncUI and await, and describes how the Kotlin compiler transforms the code.

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

## A glimpse of Async-Await on Android

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

Original publisher: [Read original article](<https://medium.com/@nhaarman/async-await-in-android-f0202cf31088?source=rss-fceb7a60a849------2>)

Author: Niek Haarman

Published: 2016-10-31T12:25:13Z

Content type: tutorial

Language: en

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

Topics: [async/await](<https://devfeed.tech/topics/async-await.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Android](<https://devfeed.tech/topics/android.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [API](<https://devfeed.tech/topics/api.md>), [GitHub API](<https://devfeed.tech/topics/github-api.md>), [Database](<https://devfeed.tech/topics/database.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>), [await](<https://devfeed.tech/tags/await.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [database](<https://devfeed.tech/tags/database.md>), [developer](<https://devfeed.tech/tags/developer.md>), [github](<https://devfeed.tech/tags/github.md>), [i](<https://devfeed.tech/tags/i.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [network](<https://devfeed.tech/tags/network.md>), [techniques](<https://devfeed.tech/tags/techniques.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This Android developer article compares several ways to perform network and I/O work without blocking the main thread, including threads, AsyncTask, callbacks, Rx, and Kotlin coroutines with async-await. Using a GitHub API example, it shows how coroutines can suspend computation while allowing continuation on the main thread, improving code readability. The article notes that it targets a preview version of Kotlin coroutines and omits cancellation and listener-removal details.

### Source excerpt

Note: this article was written for a preview version of coroutines for Kotlin. Its details have changed since then. Kotlin 1.1 will bring coroutines to the language, which allows computations to be suspended at some points and continue later on. The obvious example is async-await, as introduced a couple of years ago in C#. Every Android developer knows that when you deal with network requests and other I/O tasks, you will need to make sure you don't block the main thread, and don't touch the UI from a background thread. Over the years dozens of techniques have come and gone. This article lists a few of the most used ones, and shows an example of the goodness that async-await can bring. The scenario We will fetch a user instance from the Github api and store it in some database. When this is done we show the result on-screen. I won't be explaining the techniques, as they should speak for themselves. Plain old threads Manual, full control fun threads() { val handler = Handler() Thread { try { val user = githubApi.user() userRepository.store(user) handler.post { threadsTV.text = "threads: [$user]" } } catch(e: IOException) { handler.post { threadsTV.text = "threads: [User retrieval failed.]" } } }.start() }Android's AsyncTask Nobody uses these anymore, right? fun asyncTask() { object : AsyncTask<Unit, Unit, GithubUser?>() { private var exception: IOException? = null override fun doInBackground(vararg params: Unit): GithubUser? { try { val user = githubApi.user() userRepository.store(user) return user } catch(e: IOException) { exception = e return null } } override fun onPostExecute(user: GithubUser?) { if (user != null) { asyncTaskTV.text = "asyncTask: [$user]" } else { asyncTaskTV.text = "asyncTask: [User retrieval failed.]" } } }.execute() }Callbacks Callback-hell, anyone? fun callbacks() { githubApi.userFromCall().enqueue(object : Callback<GithubUser> { override fun onResponse(call: Call<GithubUser>, response: Response<GithubUser>) { val user = response.body() userR

## JavaScript Async/Await and ES6 Generators for Asynchronous Programming

DevFeed: [JavaScript Async/Await and ES6 Generators for Asynchronous Programming](<https://devfeed.tech/articles/javascript-from-callback-hell-to-heaven-31999.md>)

Original publisher: [Read original article](<https://tech.finn.no2015/10/16/javascript-from-callback-hell-to-heaven/>)

Author: Tor Arne Kvaløy

Published: 2015-10-16T14:00:00Z

Content type: tutorial

Language: en

Sources: [Finn.no](<https://devfeed.tech/sources/finn-no.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [async](<https://devfeed.tech/topics/async.md>), [function](<https://devfeed.tech/topics/function.md>), [Code](<https://devfeed.tech/topics/code.md>), [JSON](<https://devfeed.tech/topics/json.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [await](<https://devfeed.tech/tags/await.md>), [callback](<https://devfeed.tech/tags/callback.md>), [es6](<https://devfeed.tech/tags/es6.md>), [function](<https://devfeed.tech/tags/function.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [json](<https://devfeed.tech/tags/json.md>), [node](<https://devfeed.tech/tags/node.md>)

### AI overview

This tutorial explains how JavaScript callbacks and nested Promise chains make asynchronous code cumbersome, then shows how ES7 async/await can express asynchronous operations in a more synchronous style. It also describes the role of ES6 generators and demonstrates reading and parsing a JSON file with Node.js.

### Source excerpt

This blogpost explains how some nifty features in ES7 will make it easier to write asynchronous code, and how ES6 generators will pave the way for this. Async/await My main annoyance with javascript and Node has been the tedious asynchronous programming model of callbacks, leading to nested callbacks and the so called "callback hell" or "pyramid of doom". Take for example the following code where we are creating a function that reads a file and parses it to JSON, and see how cumbersome it is to read and follow the code: const fs = require("fs"); function readJSONFile(callback) { fs.readFile("file.json", "utf8", (err, data) => { if (err) return callback(err); let json; let parseError; try { json = JSON.parse(data); } catch(e) { parseError = e; } callback(parseError, json); }); }; readJSONFile((err, json) => { if(err) { //handle error } console.log(json); //continue program }); This was slightly improved and simplified with ES6 promises, however, as we can see in the following code, we are still stuck with nested .then-calls: const bluebird = require("bluebird"); const fs = bluebird.promisifyAll(require("fs")); function readJSONFile() { return fs.readFileAsync("file.json", "utf8") .then(data => { return JSON.parse(data); }) }; readJSONFile() .then(json => { console.log(json); //continue program }) .catch(err => { //handle error }) Callbacks and nested .then-statements will be a thing of the past with the upcoming version of Javascript (ES7). It will provide us with the keywords async and await, which will enable us to write asynchronous code as we would have written it in an imperative synchronous way: const bluebird = require("bluebird"); const fs = bluebird.promisifyAll(require("fs")); async function readJSONFile() { const data = await fs.readFileAsync("file.json", "utf8"); return JSON.parse(data); } async function() { try { const json = await readJSONFile(); console.log(json); //continue program } catch(err) { //handle error } }; The await keyword can either take a

## Async sequential workflows

DevFeed: [Async sequential workflows](<https://devfeed.tech/articles/async-sequential-workflows-38412.md>)

Original publisher: [Read original article](<https://khmylov.com/2012/04/async-sequential-workflows/>)

Author: Andrew Khmylov

Published: 2012-04-26T00:00:00Z

Content type: tutorial

Language: ru

Sources: [Despite the odds](<https://devfeed.tech/sources/despite-the-odds.md>)

Topics: [async](<https://devfeed.tech/topics/async.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [client](<https://devfeed.tech/topics/client.md>), [.NET](<https://devfeed.tech/topics/net.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [client](<https://devfeed.tech/tags/client.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [foreach](<https://devfeed.tech/tags/foreach.md>), [observable](<https://devfeed.tech/tags/observable.md>), [request](<https://devfeed.tech/tags/request.md>), [yield](<https://devfeed.tech/tags/yield.md>)

### AI overview

This tutorial compares synchronous and asynchronous implementations of sequential workflows for downloading files with .NET WebClient. It explains how sequential requests can be represented with observables and how async/await can reduce the work needed to describe the control flow.

### Source excerpt

В последнее время всё чаще приходится сталкиваться с задачами, требующими выполнения последовательных асинхронных операций. Примером может служить загрузка файлов на мобильном устройстве. Учитывая что телефон может работать на слабом мобильном соединении, нам вряд ли удастся получить прирост производительности от параллельной загрузки. Да и стандартный класс WebClient, представленный в BCL не очень дружит с concurrent operations (точнее вообще не дружит). Создавать новый экземпляр на каждый запрос кажется идейно неправильным, так что попробуем обойтись одним веб-клиентом, обрабатывающим множество последовательных запросов. Для начала - тривиальная синхронная реализация (которая конечно же не будет работать на WP7 из-за отсутствия синхронных методов у WebClient'а): public IEnumerable<string> Handle(IEnumerable<Uri> requests) { var client = new WebClient(); foreach (var request in requests) { yield return client.DownloadString(request); } } Разработчику, использующему асинхронную версии, скорее всего захочется узнать о моменте завершении загрузок. Не будем плохими мальчиками/девочками и отбросим мысли о EAP и ручном CPS. Довольно очевидным решением будет представить наши ожидающие загрузки файлы в виде потока событий при помощи observables. К сожалению, WebClient использует EAP для своих асинхронных операций, поэтому код становится чуть более неопрятным: public IObservable<string> HandleAsync(IList<Uri> requests) { var client = new WebClient(); var subject = new Subject<string>(); var enumerator = requests.GetEnumerator(); Action takeNext = () => { if (enumerator.MoveNext()) { client.DownloadStringAsync(enumerator.Current); } else { subject.OnCompleted(); } }; client.DownloadStringCompleted += (s, e) => { if (e.Error != null) { subject.OnError(e.Error); } else { subject.OnNext(e.Result); takeNext(); } }; takeNext(); return subject; } В обоих случаях мы по сути описываем корутины, передающие управление в момент окончания обработки запроса. В синхронной реализации компи