June 25, 2026
Senders/Receivers: Why Async C++ Is Changing
Asynchronous C++ has never lacked mechanisms. It lacked one common vocabulary for describing asynchronous work.
For years, real projects have mixed callbacks, custom event loops, std::future, thread pools, coroutines, framework-specific executors and library-specific async APIs. Each of these tools can be useful. The problem starts when they have to compose.
One subsystem reports completion through a callback. Another returns a future. Another uses a coroutine-friendly task. Another needs an explicit event loop. Another wants cancellation. Another silently switches threads. The result is not only technical complexity. It is API ambiguity.
C++26 changes the direction with std::execution, commonly known as senders and receivers. The interesting part is not that C++ gets yet another async abstraction. The interesting part is that the standard library finally gets a model for describing, composing and starting asynchronous work.
Note
This article focuses on the practical mental model, not every detail of the standard wording. Compiler and standard library support will take time, so treat the code examples as C++26-oriented examples and check your toolchain before using them in production.

The old problem: every async API invents its own contract
A callback-based API can look simple in the beginning:
reader.asyncRead([&](ReadResult readResult) {
if (!readResult) {
onError(readResult.error());
return;
}
parser.asyncParse(*readResult, [&](ParseResult parseResult) {
if (!parseResult) {
onError(parseResult.error());
return;
}
storage.asyncWrite(*parseResult, [&](WriteResult writeResult) {
if (!writeResult) {
onError(writeResult.error());
return;
}
onDone();
});
});
});
This is not bad because it uses callbacks. It is bad because the contract is spread across nested lambdas and comments.
- Where does each callback run? Same thread, I/O thread, worker thread, event loop?
- Who owns captured objects? Is
thisstill alive when the callback runs? - How is cancellation represented? Error? Boolean? Special status? No callback?
- How are errors propagated? Exception, error code, optional, custom result?
- Can the operations be composed? Or does every layer need another adapter?
In small code this is manageable. In a real embedded Linux daemon, networking component, media pipeline, OTA updater or UI backend, this style slowly becomes hard to reason about.
Common failure mode
The first callback is usually clean. The fifth callback often contains lifetime assumptions, error mapping, cancellation behavior and thread switching hidden inside lambdas.

What senders and receivers are trying to standardize
std::execution gives C++ a vocabulary for asynchronous execution. The proposal behind it describes a model built around schedulers, senders and receivers, with customizable async algorithms. The goal is to make async work composable and generic rather than tied to one framework.
The short mental model is:
- Sender — describes asynchronous work. It is a recipe, not necessarily a running task.
- Receiver — consumes the result of that work. It receives success, error or stopped completion.
- Operation state — the concrete state created when a sender is connected to a receiver.
- Scheduler — represents where work can be scheduled, such as an event loop, thread pool, GPU stream or another execution context.
This matters because an async operation is no longer just “a function that eventually calls a callback”. It becomes an object that can be adapted, composed, connected and started according to a clear contract.

A sender is a description, not necessarily a running task
This is the first mental shift. With many traditional async APIs, calling the function starts work immediately. With senders, creating the sender often only builds a description of work.
#include <execution>
namespace ex = std::execution;
auto work =
ex::then(
ex::just(Packet{"hello"}),
[](Packet packet) {
return validate(packet);
});
// At this point, "work" describes an operation.
// It has not necessarily started doing work.
This is similar to how a range view describes a transformation before you iterate it. A sender graph can describe asynchronous work before you connect it to a receiver and start it.
That separation is useful. You can build a pipeline, pass it around, adapt it, attach error handling and only then decide how it should run.
Tip
When reading sender-based code, ask: is this line building a description of work, or is it consuming/starting the work? That distinction is central to the model.
connect + start makes lifetime visible
The lower-level shape of the model is explicit:
auto sender = ex::then(ex::just(21), [](int value) {
return value * 2;
});
auto operation = ex::connect(std::move(sender), LoggingReceiver{});
ex::start(operation);
connect combines a sender and a receiver and creates an operation state. start begins the operation. That sounds more verbose than a callback, but it exposes something important: asynchronous work has state, and that state has a lifetime.
This is one of the parts that matters in real systems. If an operation uses buffers, device handles, event loop registrations, cancellation callbacks or captured objects, the operation state is where that relationship becomes real.
Warning
Starting async work without thinking about the operation state lifetime is the sender/receiver version of capturing this in a callback without a lifetime plan.

Receivers are callbacks with a stronger contract
A normal callback often has only one channel: “here is the result”. Then we have to encode failure and cancellation manually. A receiver has three completion channels:
set_value— the operation completed successfully and produced values.set_error— the operation failed.set_stopped— the operation was cancelled or stopped before success or failure.
That distinction is practical. Cancellation is not the same as failure. A stopped OTA download, a cancelled UI action and a failing flash write should not all be squeezed into one generic “error” callback.
struct LoggingReceiver
{
using receiver_concept = std::execution::receiver_tag;
void set_value(Packet packet) && noexcept
{
logInfo("packet received");
handle(packet);
}
void set_error(std::exception_ptr error) && noexcept
{
logError("packet operation failed");
report(error);
}
void set_stopped() && noexcept
{
logInfo("packet operation was cancelled");
}
std::execution::empty_env get_env() const noexcept
{
return {};
}
};
Most application code will not manually write receivers like this. It will use sender algorithms and library utilities. But understanding the receiver contract helps explain why the model is different from a simple callback.

Composition becomes the main feature
The practical benefit is composition. Instead of nesting callbacks, you build a graph of work.
auto loadAndValidate =
ex::then(readConfigFile("/etc/device/config.json"), parseConfig);
auto startDevice =
ex::then(std::move(loadAndValidate), [](Config config) {
return DeviceConfig{std::move(config)};
});
In real code, the useful part is not that the syntax is shorter. The useful part is that the pipeline can be transformed. You can attach error handling, change scheduler boundaries, combine operations or turn cancellation into a value depending on the API contract.
auto safeLoad =
ex::let_error(
readConfigFile("/etc/device/config.json"),
[](FileError error) {
return loadDefaultConfig(error);
});
This is the same design pressure that made ranges useful for synchronous data processing. Senders try to bring a similar composition style to asynchronous work.
Note
The exact set of algorithms and implementation support may vary while C++26 support lands in standard libraries. The important design idea is stable: async operations become composable values.

This does not replace coroutines
It is tempting to frame this as “senders versus coroutines”. That is the wrong comparison.
Coroutines are a language feature for suspending and resuming functions. They provide syntax. They do not, by themselves, define your scheduler, cancellation model, error channel, thread switching rules or async resource lifetime. Every project still needs a task type and runtime conventions around them.
Senders and receivers provide a library model for asynchronous operations. They can be used without coroutines, and they can also integrate with coroutine-based code.
| Question | Coroutine alone | Sender/receiver model |
|---|---|---|
| How do I suspend code? | co_await | Not the main purpose |
| How do I describe async work as a value? | Depends on task type | sender |
| How do I compose async work generically? | Depends on framework | Sender algorithms |
| How do I represent cancellation separately from error? | Depends on task type | set_stopped channel |
| Where does work run? | Depends on awaitable/runtime | Scheduler/environment model |
In practice, many codebases may use both. Coroutines can make some async control flow easier to read. Senders can provide the common vocabulary that lets libraries compose.

Why std::future was not enough
std::future looked like the original standard answer to asynchronous results, but it never became a good foundation for modern async APIs.
- It is awkward to compose without blocking or adding extra machinery.
- It does not naturally express scheduler boundaries.
- It does not provide a rich cancellation channel.
- It encourages a “get the result later” mental model rather than a composable async graph.
- It is difficult to adapt cleanly across different execution resources.
That does not mean every use of std::future is wrong. It means std::future is not enough as the common abstraction for modern asynchronous and parallel C++.
Rule of thumb
Use std::future when a simple one-shot result is enough. Reach for sender-style APIs when you need composition, scheduler control, cancellation and typed async boundaries.
Why this matters for embedded and system-level C++
In embedded and system-level C++, asynchronous code is everywhere, even when nobody calls it “async programming”.
- A D-Bus service waits for method calls and emits signals.
- A network component waits for sockets, timers and reconnects.
- An OTA updater coordinates download, verification, installation and reboot.
- A device service reacts to GPIO, UART, CAN, SOME/IP, UDS or watchdog events.
- A media pipeline schedules work across CPU, decoder, renderer and buffer queues.
These systems already have schedulers, event loops and completion paths. The problem is that each subsystem often expresses them differently.
Senders and receivers are interesting because they create a common shape for these operations. A read operation, a timer, a retry policy, an error recovery step and a cancellation path can all be represented as parts of one async graph.
Embedded caution
The model does not magically remove allocation, synchronization or scheduling costs. In hot paths, low-latency systems and memory-constrained targets, you still need to understand what your implementation does.

A small before/after example
Imagine an API that reads a packet, validates it and writes it to storage.
A callback version might look like this:
void processPacket(Reader& reader, Storage& storage, CompletionHandler done)
{
reader.asyncRead([&storage, done = std::move(done)](ReadResult result) mutable {
if (!result) {
done(Result::readError(result.error()));
return;
}
if (!isValid(*result)) {
done(Result::invalidPacket());
return;
}
storage.asyncWrite(*result, [done = std::move(done)](WriteResult write) mutable {
if (!write) {
done(Result::writeError(write.error()));
return;
}
done(Result::success());
});
});
}
This version mixes workflow, error mapping, lifetime and completion in one function.
A sender-style API can expose the workflow as a value:
auto processPacket(Reader& reader, Storage& storage)
{
return ex::let_value(reader.asyncRead(), [&](Packet packet) {
if (!isValid(packet)) {
return ex::just_error(ProcessError::InvalidPacket);
}
return storage.asyncWrite(std::move(packet));
});
}
The second version is not automatically perfect. It still needs a good reader API, a good storage API and clear ownership. But it moves the design toward composition: processPacket returns asynchronous work instead of immediately starting work and hiding the control flow inside callbacks.
Practical design point
A sender-returning function can say: “here is the work to do.” The caller can decide how to compose it, where to schedule it and when to start it.
The API design change: return work, do not always start work
This may be the biggest practical change in how we design asynchronous APIs.
Instead of:
void asyncConnect(Endpoint endpoint, ConnectCallback callback);
A sender-style API tends to look more like:
sender auto connect(Endpoint endpoint);
The function no longer needs to take a callback just to report completion. It returns an object representing the operation. That object can be adapted and composed before it runs.
This makes API review more interesting. The key questions become:
- Does this function merely describe work, or does it start work immediately?
- What are the possible completion signatures?
- Which scheduler or execution context does the work use?
- How is cancellation observed?
- Who owns the operation state?
- Can this operation be combined with other operations without losing error information?

Common mistakes when learning senders
Senders and receivers can look intimidating because the standard model is generic and customizable. The practical mistakes are usually simpler.
- Thinking a sender is always already running. Many senders are descriptions of work until they are connected and started or consumed.
- Ignoring operation state lifetime. The connected operation owns important async state.
- Treating cancellation as an error. The model separates stopped completion from error completion for a reason.
- Expecting a magic standard thread pool. The important abstraction is the scheduler and execution context. Your implementation or framework still matters.
- Trying to write custom senders too early. Most teams should first learn to consume and compose sender-returning APIs.
- Using sender pipelines to hide bad ownership. A new abstraction does not fix dangling references or unclear object lifetime.
Warning
Do not adopt senders only because they are new. Adopt the model where async composition, cancellation and scheduler boundaries are real problems in your codebase.
A practical decision table
A useful way to think about async API design after C++26:
| Situation | Old common choice | Sender/receiver angle |
|---|---|---|
| One local synchronous calculation | Return a value | Still return a value |
| Simple C-style event hook | Function pointer or callback | Callback may still be fine |
| One-shot async operation | Callback or future | Return a sender describing the operation |
| Pipeline of async steps | Nested callbacks or custom task type | Compose senders with algorithms |
| Needs cancellation | Custom flag or special error | Use stopped completion / stop token model |
| Needs explicit execution context | Pass thread pool or event loop manually | Expose scheduler/environment clearly |
| Hot embedded data path | Custom optimized path | Use sender model carefully; profile implementation costs |
What to watch in code reviews
When sender/receiver style starts appearing in a codebase, review the contract, not only the syntax.
- Is the function name clear about whether it starts work or returns work?
- Are value, error and stopped paths all visible?
- Does the code make scheduler boundaries explicit?
- Is object lifetime safe if completion happens later or on another thread?
- Does the API preserve useful error information?
- Does cancellation clean up resources correctly?
- Is the implementation appropriate for the target system, especially in embedded or low-latency paths?
This is similar to callback design. The syntax changed, but the engineering questions did not disappear. They became more explicit.
The key idea
If you remember only one thing, remember this:
Tip
Senders and receivers are not just “callbacks with more templates”. They are a standard vocabulary for describing asynchronous work, composing it, connecting it to completion handling and starting it with explicit lifetime.
C++ async is changing because modern software needs more than “run something later”. It needs a way to describe where work runs, how it completes, how it fails, how it is cancelled and how it composes with other work.
That is what std::execution is trying to bring into the standard library. It will not make asynchronous code simple. But it can make the contracts visible — and in large C++ systems, visible contracts are often the difference between code that merely works today and code that can be maintained tomorrow.