class BroadcastPoolProxy extends PoolProxy implements Broadcaster

Properties

protected Closure|null $authenticatedUserCallback

The callback to resolve the authenticated user information.

Methods

__construct(PoolDefinition $definition, Closure $resolver, Factory $pools, Closure|null $releaseCallback = null)

Create a proxy that resolves its current pool per operation.

pool()

Resolve the current pool for this proxy's definition.

lease()

Borrow an object under an exactly-once lease.

mixed
invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

void
configureBorrowed(object $object)

Apply this proxy's authenticated-user callback to a borrowed broadcaster.

getDefinition()

Get this proxy's immutable pool definition.

string
getPoolName()

Get this proxy's pool identity.

bool
invalidatePool()

Remove and close this proxy's current shared pool.

array|null
resolveAuthenticatedUser(Request $request)

Resolve the authenticated user payload for the incoming connection request.

void
resolveAuthenticatedUserUsing(Closure|null $callback)

Register the user retrieval callback used to authenticate connections.

channel(HasBroadcastChannel|string $channel, callable|string $callback, array $options = [])

Register a channel authenticator.

mixed
auth(Request $request)

Authenticate the incoming request for a given channel.

mixed
validAuthenticationResponse(Request $request, mixed $result)

Return the valid authentication response.

void
broadcast(array $channels, string $event, array $payload = [])

Broadcast the given event.

getChannels()

Get all of the registered channels.

Details

in PoolProxy at line 17
__construct(PoolDefinition $definition, Closure $resolver, Factory $pools, Closure|null $releaseCallback = null)

Create a proxy that resolves its current pool per operation.

Parameters

PoolDefinition $definition
Closure $resolver
Factory $pools
Closure|null $releaseCallback

in PoolProxy at line 28
protected ObjectPool pool()

Resolve the current pool for this proxy's definition.

Return Value

ObjectPool

in PoolProxy at line 36
protected Lease lease()

Borrow an object under an exactly-once lease.

Return Value

Lease

in PoolProxy at line 59
protected mixed invoke(string $method, array $arguments)

Invoke a synchronous method on a borrowed object.

Parameters

string $method
array $arguments

Return Value

mixed

at line 88
protected void configureBorrowed(object $object)

Apply this proxy's authenticated-user callback to a borrowed broadcaster.

Parameters

object $object

Return Value

void

in PoolProxy at line 90
PoolDefinition getDefinition()

Get this proxy's immutable pool definition.

Return Value

PoolDefinition

in PoolProxy at line 98
string getPoolName()

Get this proxy's pool identity.

Return Value

string

in PoolProxy at line 106
bool invalidatePool()

Remove and close this proxy's current shared pool.

Return Value

bool

at line 26
array|null resolveAuthenticatedUser(Request $request)

Resolve the authenticated user payload for the incoming connection request.

Parameters

Request $request

Return Value

array|null

at line 37
void resolveAuthenticatedUserUsing(Closure|null $callback)

Register the user retrieval callback used to authenticate connections.

Boot-only. The callback persists in instance state on the cached pool proxy for the worker lifetime; per-request use races across coroutines.

Parameters

Closure|null $callback

Return Value

void

at line 49
BroadcastPoolProxy channel(HasBroadcastChannel|string $channel, callable|string $callback, array $options = [])

Register a channel authenticator.

Boot-only. Delegates to the underlying broadcaster; the channel authorizer and options persist in shared static state on the Broadcaster class for the worker lifetime.

Parameters

HasBroadcastChannel|string $channel
callable|string $callback
array $options

Return Value

BroadcastPoolProxy

at line 56
mixed auth(Request $request)

Authenticate the incoming request for a given channel.

Parameters

Request $request

Return Value

mixed

at line 64
mixed validAuthenticationResponse(Request $request, mixed $result)

Return the valid authentication response.

Parameters

Request $request
mixed $result

Return Value

mixed

at line 72
void broadcast(array $channels, string $event, array $payload = [])

Broadcast the given event.

Parameters

array $channels
string $event
array $payload

Return Value

void

at line 80
Collection getChannels()

Get all of the registered channels.

Return Value

Collection