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

Commit

Permalink
Added broadcastLocallyToEveryoneExcept
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki committed Sep 18, 2020
1 parent bab2ef2 commit 9856fb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ChannelManagers/RedisChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ public function onMessage(string $redisChannel, string $payload)
unset($payload->serverId);
unset($payload->appId);

$channel->broadcastToEveryoneExcept($payload, $socketId, $appId, false);
$channel->broadcastLocallyToEveryoneExcept($payload, $socketId, $appId);
}

/**
Expand Down
15 changes: 15 additions & 0 deletions src/Channels/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ public function broadcastToEveryoneExcept(stdClass $payload, ?string $socketId,
return true;
}

/**
* Broadcast the payload, but exclude a specific socket id.
*
* @param \stdClass $payload
* @param string|null $socketId
* @param string|int $appId
* @return bool
*/
public function broadcastLocallyToEveryoneExcept(stdClass $payload, ?string $socketId, $appId)
{
return $this->broadcastToEveryoneExcept(
$payload, $socketId, $appId, false
);
}

/**
* Check if the signature for the payload is valid.
*
Expand Down

0 comments on commit 9856fb6

Please sign in to comment.