Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Nov 17, 2023
1 parent ce68666 commit a167974
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Managers/ChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public function unsubscribe(Channel $channel, Connection $connection): void
unset($this->connections[$this->application->id()][$channel->name()][$connection->id()]);
}

/**
* Unsubscribe from a channel.
*/
public function unsub(string $channel, Connection $connection): void
{
unset($this->connections[$this->application->id()][$channel][$connection->id()]);
}

/**
* Get all the channels.
*/
Expand All @@ -72,7 +80,7 @@ public function all(): Collection
public function unsubscribeFromAll(Connection $connection): void
{
$this->channels()->each(function ($connections, $name) use ($connection) {
ChannelBroker::create($name)->unsubscribe($connection);
$this->unsub($name, $connection);
});
}

Expand Down

0 comments on commit a167974

Please sign in to comment.