DevPrep

All topics › Combine

How do you bridge Combine and async/await: .values, Future from async, and AsyncStream?

Senior PRO

The gist

There are three bridges: publisher.values (Combine → async), an async function inside Deferred + Future (async → Combine), and AsyncStream instead of a subject. Syntactically they are simple; in an interview they check the semantics — how cancellation carries over and what happens to values when the consumer can't keep up.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store