You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support to incrementally feed the parser via an explicit method call where the pull approach of foreach cannot be used. Useful for example for curl's CURLOPT_WRITEFUNCTION or when receiving json chunks in an event loop.
Proposed usage (implicit):
$items = newPushItems(['pointer' => '/results']);
$callback = function ($jsonChunk) use ($items) {
$items->push($jsonChunk);
foreach($itemsas$item) {
// process currently available items
}
}
or more explicit (similar to current API):
$queue = newQueueChunks();
$items = Items::fromQueue($queue, ['pointer' => '/results']);
$callback = function ($jsonChunk) use ($items, $queue) {
$queue->push($jsonChunk);
foreach($itemsas$item) {
// process currently available items
}
}
Any other proposal?
The text was updated successfully, but these errors were encountered:
Support to incrementally feed the parser via an explicit method call where the pull approach of foreach cannot be used. Useful for example for curl's
CURLOPT_WRITEFUNCTION
or when receiving json chunks in an event loop.Proposed usage (implicit):
or more explicit (similar to current API):
Any other proposal?
The text was updated successfully, but these errors were encountered: