liveBook · Manning

Async function

An async function is a function whose result is represented by an asynchronous computation, allowing execution to suspend while asynchronous operations complete.

How 3 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

A JavaScript function marked as asynchronous that can use await and returns a promise.

How it is used
Uses async functions to sequence dependent asynchronous tasks without blocking the UI.
How deep it goes
Explains async and await syntax and their role in coordinating promises, while leaving the underlying machinery out of the code.
Examples
Demonstrates sequential JSON requests for ninja, mission, and mission-detail data, with try/catch error handling.
What you can do after
Apply async/await to sequence dependent requests without blocking and handle failures with try/catch.

Read how Secrets of the JavaScript Ninja, Second Edition explains async function →

Secrets of the JavaScript Ninja, Third Edition

The async keyword marks a function whose return value is wrapped in a promise and whose thrown errors reject that promise.

How it is used
Produces promises without explicit construction, enabling functions to participate in promise-based workflows.
How deep it goes
Defines value resolution and error rejection, then demonstrates their use in a fetch-and-parse workflow.
Examples
Uses a function returning a string and a fetchJson request that checks response status before parsing JSON.
What you can do after
Apply async functions to return promise results and turn thrown errors into promise rejections.

Read how Secrets of the JavaScript Ninja, Third Edition explains async function →

Building LLM Applications with DSPy

The Python async keyword declares a coroutine function that can use await expressions.

How it is used
Uses coroutine functions to let I/O-bound tasks yield while remote services respond.
How deep it goes
Defines async def and explains cooperative pausing, but does not detail coroutine implementation internals.
Examples
Demonstrates two coroutine functions waiting for different durations and returning results through asyncio.gather.
What you can do after
Build coroutine functions with async def for tasks that can pause during I/O waits.

Read how Building LLM Applications with DSPy explains async function →

What to know first

Related concepts

Questions about async function

What is async function?

An async function is a function whose result is represented by an asynchronous computation, allowing execution to suspend while asynchronous operations complete.

Which Manning books explain async function?

Secrets of the JavaScript Ninja, Second Edition, Secrets of the JavaScript Ninja, Third Edition and Building LLM Applications with DSPy.

What should I know before learning async function?

Manning books that teach async function usually introduce arrow function, asynchronous programming, thread and function first.

What is async function part of?

Async function is part of ECMAScript language specification. The ECMAScript language specification is the formal standard defining the syntax, semantics, and built-in behavior of the ECMAScript programming language.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.