The pull model makes the consumer initiate every request for data. A producer may be a function or another data source, but it does not know when data is needed; the consumer calls it when ready. section 9.3.1
Pull contrasts with push, where the producer controls when values arrive. In JavaScript, invoking a function or repeatedly calling an iterator’s next method are pull operations; promises and asynchronous generators represent push-oriented alternatives. section 9.3.1
Common pull forms include:
- A function returns data when the consumer invokes it. section 9.3.1
- An iterator supplies successive values as the consumer calls next repeatedly. section 9.3.1
- Arrays expose pull access through indexing, methods such as indexOf, and Symbol.iterator. section 9.3.2
Polling versus notification
An array can be checked at intervals to discover whether it has changed, but that long-polling approach repeatedly picks at the data. A push design instead lets the producer notify subscribers when a value arrives. section 9.3.2
Figure 9.2 The difference between pull and push. With pull, the consumer must always initiate a request for data. With push, when the consumer subscribes, the producer sends data as it becomes available, stopping when the consumer unsubscribes or when there’s no more data to send.
Compare the direction of control: pull requires the consumer to initiate each request, while push lets the producer send values after subscription. section 9.3.1



