From the course: Learning Combine with Swift
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Throttle publisher data with backpressure - Swift Tutorial
From the course: Learning Combine with Swift
Throttle publisher data with backpressure
- [Narrator] Backpressure is a quite overlooked, yet powerful control knob in Combine. We will spend a few minutes going through what backpressure is, and why you'd want to make use of it. In Combine, remember publishers only exist because of subscribers. As if often called a pull design, not a push design. Being a Subscriber-centric paradigm the subscriber tells the publisher it wants a subscription. It wants to ingest values emitted from the publisher. And also specify how many to ingest. Backpressure can be thought of as a tap, and you set the tap, or demand, of how much flow to be delivered through the tap continuously by turning the knob. Which then increases the demand incrementally, or vice versally decreases. As part of controlling down stream values, you have a few options at your disposal. Within your normal operators, you can set various buffering attributes such as with flatMap, which would constrain upstream…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Manage threads with schedulers4m 24s
-
(Locked)
Work with custom publishers and subscribers4m 45s
-
(Locked)
Throttle publisher data with backpressure4m 53s
-
(Locked)
Abstract Combine implementations with type erasures2m 8s
-
(Locked)
Leverage the Combine advanced operators5m 5s
-
(Locked)
Challenge: Call an API using schedulers and backpressure39s
-
(Locked)
Solution: Call an API using schedulers and backpressure2m 44s
-
(Locked)
-