@@ -153,10 +153,7 @@ What this means is that these endpoints actually emit any number of progress
153153events (individual JSON objects).
154154
155155The user-facing API hides this fact by resolving with an array of all individual
156- progress events once the stream ends.
157-
158- These progress events can also be accessed individually via the Promise
159- progress handler like this:
156+ progress events once the stream ends:
160157
161158``` php
162159$client->imageCreate('clue/streamripper')->then(
@@ -165,9 +162,6 @@ $client->imageCreate('clue/streamripper')->then(
165162 },
166163 function ($error) {
167164 // an error occurred (possibly after receiving *some* elements)
168- },
169- function ($element) {
170- // will be invoked for *each* complete $element in the JSON stream
171165 }
172166);
173167```
@@ -177,8 +171,9 @@ this API has to keep all event objects in memory until the Promise resolves.
177171This is easy to get started and usually works reasonably well for the above
178172API endpoints.
179173
180- If you're dealing with lots of concurrent requests (100+),
181- it could be a better idea to use a streaming approach,
174+ If you're dealing with lots of concurrent requests (100+) or
175+ if you want to access the individual progress events as they happen, you
176+ should consider using a streaming approach instead,
182177where only individual progress event objects have to be kept in memory.
183178The following API endpoints complement the default Promise-based API and return
184179a [ ` Stream ` ] ( https://github.com/reactphp/stream ) instance instead:
0 commit comments