Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 29, 2023
1 parent e538ceb commit 23eb0c8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/Channels/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Laravel\Reverb\Contracts\ChannelConnectionManager;
use Laravel\Reverb\Contracts\Connection;
use React\Promise\Deferred;
use Spatie\Fork\Fork;

class Channel
{
Expand Down Expand Up @@ -109,15 +108,13 @@ public function broadcastToAll(array $payload): void
$chunks = array_chunk($this->connections(), 5000);

array_map(function ($connections) use ($message) {
return function () use ($connections, $message) {
$promise = new Deferred;

$promise->resolve(function () use ($connections, $message) {
foreach ($connections as $connection) {
$connection->send($message);
}
});
};
$promise = new Deferred;

$promise->resolve(function () use ($connections, $message) {
foreach ($connections as $connection) {
$connection->send($message);
}
});
}, $chunks);
}

Expand Down

0 comments on commit 23eb0c8

Please sign in to comment.