Quantcast
Channel: Combine: Asynchronous Programming with Swift - Kodeco Forums
Viewing all articles
Browse latest Browse all 26

Question for Combine: Asynchronous Programming with Swift

$
0
0

Hello
I am studying Combine with the book, and I have questions on Chapter 18.

  1. There is a description like below, and I can not understand what it means. Specifically on bold text.
  1. Use the handy AnySubscriber class which takes closures, and immediately request .unlimited values upon subscription to let the publisher run to completion.

Why does the publisher run to completion when I use .unlimited?

  1. And there is the other description like,

Note: You could initially request .max(self.capacity) and receive just that, but remember that Combine is demand-driven! If you don’t request as many values as the publisher is capable of producing, you may never get a completion event!

I’m just curios why I can’t get completion when using .max(n).
If I set .max(2), I can get completion after getting two values. Can’t I?

Thanks.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 26

Trending Articles