Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 9856fb6

Browse files
committed
Added broadcastLocallyToEveryoneExcept
1 parent bab2ef2 commit 9856fb6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/ChannelManagers/RedisChannelManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ public function onMessage(string $redisChannel, string $payload)
462462
unset($payload->serverId);
463463
unset($payload->appId);
464464

465-
$channel->broadcastToEveryoneExcept($payload, $socketId, $appId, false);
465+
$channel->broadcastLocallyToEveryoneExcept($payload, $socketId, $appId);
466466
}
467467

468468
/**

src/Channels/Channel.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,21 @@ public function broadcastToEveryoneExcept(stdClass $payload, ?string $socketId,
164164
return true;
165165
}
166166

167+
/**
168+
* Broadcast the payload, but exclude a specific socket id.
169+
*
170+
* @param \stdClass $payload
171+
* @param string|null $socketId
172+
* @param string|int $appId
173+
* @return bool
174+
*/
175+
public function broadcastLocallyToEveryoneExcept(stdClass $payload, ?string $socketId, $appId)
176+
{
177+
return $this->broadcastToEveryoneExcept(
178+
$payload, $socketId, $appId, false
179+
);
180+
}
181+
167182
/**
168183
* Check if the signature for the payload is valid.
169184
*

0 commit comments

Comments
 (0)