About This Title

Pages: 574
Published: March 2023
ISBN: 9781944994044
In Print

The Curious Case of the Async Cafe

An Introduction to Modern Concurrency in Swift

by Daniel H Steinberg

Swift’s new async/await family is a language level solution for asynchronous and concurrent code. This book introduces the new keywords and additions to the Swift Standard Library, digs into how and when you should use them, and tells you what pitfalls to avoid. You’ll learn to replace traditional approaches to working with callbacks and concurrency with simpler code that is easier to read and reason about.


This work was written and produced entirely by the author. We are proud to be distributing it.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

Get all eBook formats here for $30.00 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal


Swift’s solution to asynchronous and concurrent code is now part of the language itself. The new syntax, which in the past was complicated, fragmented, or deeply nested, is easier to read and follows a logical flow. With async/await you’ll focus on tasks instead of threads or even queues.

The Curious Case of the Async Cafe is a quirky, fast-paced tour of the components of modern concurrency in Swift: async; await; Tasks; using continuations to replace and wrap delegates and closure-based APIs; AsyncSequences and AsyncStreams; structured concurrency using async let and Task Groups; and, of course, actors.

What You Need

You need the latest publicly shipping version of Xcode running on your Mac. At the time of publication this is Xcode 14.2.

Source code, Errata, Typos, Suggestions

Resources

Releases:

  • P1.0 2023/03/07

Contents & Extracts

  • Copyright and Legal
    • Copyright
    • Book Version
    • Code Download
    • Recommended Settings
    • Submit Errata
    • Official Links
    • Legal
  • Chapter 0: Introduction
    • Edges
    • Road Map
    • Credits, Bio, and Version History
  • Chapter 1: Async, Await, and Task excerpt
    • We Begin
    • Errors
    • The (too) Big Sleep
    • Introducing async / await
    • Task
    • Async and Errors
    • Testing
    • Be Careful
  • Chapter 2: Continuations
    • The Delegate Pattern
    • Delegate to Continuations
    • Multiple Continuations
    • Unsafe Continuations
    • Throwing Continuations
    • Closures and Callbacks
    • Async Alternatives
    • Async Wrappers
    • Refactorings
    • URLSession and Closures with Errors
  • Chapter 3: AsyncSequences and AsyncStreams excerpt
    • Notifications
    • Introducing AsyncStream
    • Sequences of Notifications
    • Sendable and Actor Boundaries
    • Transforming AsyncSequences
    • Sequence Pipelines
    • Combine
    • AsyncStream Continuations
    • Continuous Delivery
    • AsyncAlgorithms
  • Chapter 4: Structured Concurrency excerpt
    • Unstructured Async Calls
    • Async Let
    • Cancelling Tasks
    • Task Values
    • Unstructured App Store Search
    • TaskGroups
    • Sequences of TaskGroups
    • AsyncImage
  • Chapter 5: Actors
    • On and Off the MainActor
    • Shared Mutable State
    • Actors
    • Suspending and Reentrancy
    • Nonisolated Members
    • Communication between Actors
    • Global Actors
    • Creating Distributed Actors
    • Using Distributed Actors
    • Epilogue

Author

Daniel H Steinberg is the author of more than a dozen books including the best selling books A Combine Kickstart, A SwiftUI Kickstart, A Swift Kickstart, Second Edition, A Functional Programming Kickstart, and Dear Elena. He has written apps for the iPhone and the iPad since the SDKs first appeared and has written programs for the Mac all the way back to System 7.

Daniel presents iOS, Functional Programming, SwiftUI, and Swift training and consults through his company Dim Sum Thinking. When he’s not coding or talking about coding for the Mac, the iPhone, and the iPad he’s probably cooking, baking bread, or hanging out with friends. Details on his training and speaking are on the Dim Sum Thinking website.

eBook Formats:

  • PDF for desktop/tablets

  • epub for Apple Books, e-readers

Get all eBook formats here for $30.00 (USD)

Add to Cart we accept visa, mastercard, amex, discover, paypal

Related Titles:

About This Title

Pages: 574
Published: March 2023
ISBN: 9781944994044
Edition: 1
In Print