0Pricing
Swift Academy · Lesson

Schedulers and Threading

Control execution with receive(on:) and subscribe(on:).

Schedulers in Combine

A scheduler in Combine defines when and where work runs — which thread or queue executes the operators and delivers values to subscribers.

Controlling schedulers is essential for keeping UI updates on the main thread and heavy work off it.

Two Key Operators

Combine gives you two operators to control threading:

  • subscribe(on:) — controls where the subscription and upstream work begins
  • receive(on:) — controls where downstream values are delivered

They affect different ends of the pipeline.

All lessons in this course

  1. Transforming and Combining Streams
  2. Schedulers and Threading
  3. Error Handling Operators
  4. Custom Publishers and Subscribers
← Back to Swift Academy