Skip to content

Commit 8c0848f

Browse files
committedJun 18, 2024
readme: mention pooling for scaling
1 parent 1fe9d17 commit 8c0848f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $notifications = [
6060
'payload' => '{"message":"Hello World!"}',
6161
], [
6262
// current PushSubscription format (browsers might change this in the future)
63-
'subscription' => Subscription::create([
63+
'subscription' => Subscription::create([
6464
"endpoint" => "https://example.com/other/endpoint/of/another/vendor/abcdef...",
6565
"keys" => [
6666
'p256dh' => '(stringOf88Chars)',
@@ -253,18 +253,18 @@ foreach ($webPush->flush() as $report) {
253253
echo "[v] Message sent successfully for subscription {$endpoint}.";
254254
} else {
255255
echo "[x] Message failed to sent for subscription {$endpoint}: {$report->getReason()}";
256-
256+
257257
// also available (to get more info)
258-
258+
259259
/** @var \Psr\Http\Message\RequestInterface $requestToPushService */
260260
$requestToPushService = $report->getRequest();
261-
261+
262262
/** @var \Psr\Http\Message\ResponseInterface $responseOfPushService */
263263
$responseOfPushService = $report->getResponse();
264-
264+
265265
/** @var string $failReason */
266266
$failReason = $report->getReason();
267-
267+
268268
/** @var bool $isTheEndpointWrongOrExpired */
269269
$isTheEndpointWrongOrExpired = $report->isSubscriptionExpired();
270270
}
@@ -364,6 +364,7 @@ Here are some ideas:
364364
1. Make sure MultiCurl is available on your server
365365
2. Find the right balance for your needs between security and performance (see above)
366366
3. Find the right batch size (set it in `defaultOptions` or as parameter to `flush()`)
367+
4. Use `flushPooled()` instead of `flush()`. The former uses concurrent requests, accelerating the process and often doubling the speed of the requests.
367368

368369
### How to solve "SSL certificate problem: unable to get local issuer certificate"?
369370

0 commit comments

Comments
 (0)