class ScopedChannelManager implements ScopedChannelManager

Immutable scoped proxy for the ArrayChannelManager.

Captures the Application and delegates all operations to the underlying manager with the app ID. This is coroutine-safe — each caller gets its own proxy instance with a fixed app scope.

Methods

__construct(Application $application, ArrayChannelManager $manager)

Create a new scoped channel manager instance.

app()

Get the application instance.

array
all()

Get all the channels.

bool
exists(string $channel)

Determine whether the given channel exists.

Channel|null
find(string $channel)

Find the given channel.

findOrCreate(string $channel)

Find the given channel or create it if it doesn't exist.

array
connections(string|null $channel = null)

Get all connections for the given channels.

findConnection(string $socketId)

Find a connection by its socket ID.

void
unsubscribeFromAll(Connection $connection)

Unsubscribe from all channels.

void
remove(Channel $channel)

Remove the given channel.

Details

at line 25
__construct(Application $application, ArrayChannelManager $manager)

Create a new scoped channel manager instance.

Parameters

Application $application
ArrayChannelManager $manager

at line 34
Application app()

Get the application instance.

Return Value

Application

at line 44
array all()

Get all the channels.

Return Value

array

at line 52
bool exists(string $channel)

Determine whether the given channel exists.

Parameters

string $channel

Return Value

bool

at line 60
Channel|null find(string $channel)

Find the given channel.

Parameters

string $channel

Return Value

Channel|null

at line 68
Channel findOrCreate(string $channel)

Find the given channel or create it if it doesn't exist.

Parameters

string $channel

Return Value

Channel

at line 78
array connections(string|null $channel = null)

Get all connections for the given channels.

Parameters

string|null $channel

Return Value

array

at line 86
ChannelConnection|null findConnection(string $socketId)

Find a connection by its socket ID.

Parameters

string $socketId

Return Value

ChannelConnection|null

at line 94
void unsubscribeFromAll(Connection $connection)

Unsubscribe from all channels.

Parameters

Connection $connection

Return Value

void

at line 102
void remove(Channel $channel)

Remove the given channel.

Parameters

Channel $channel

Return Value

void