trait CreatesMercureDrivers

Constants

protected DEFAULT_MERCURE_ALGORITHM

Methods

createMercureDriver(array $config)

Create an instance of the driver.

HubInterface
mercure(array $config)

Get a Mercure hub instance for the given configuration.

bool
broadcastsToSynchronousMercureConnections(mixed $event)

Determine if the given event only targets Mercure connections publishing synchronously.

mercurePoolDefinition(array $config)

Identify the shared HTTP-client pool for construction and invalidation.

int
mercureSubscribeExpiration(array $config)

Get the subscriber token (and cookie) lifetime in whole seconds.

TokenFactoryInterface|null
mercureSubscribeFactory(array $config)

Get the subscriber token factory for the given Mercure configuration.

TokenFactoryInterface
mercureTokenFactory(TokenFactoryInterface $factory, array $claims, array $config)

Add configured claims and resolve the default audience when a token is minted.

mercureChannelEncrypter(array $config)

Get the end-to-end channel encrypter for the given Mercure configuration.

array
mercurePublishClaims(array $config)

Get the additional JWT claims for the publisher side of the given Mercure configuration.

string
mercureSecret(array $config, string $side)

Get the JWT secret for the given side ("subscribe" or "publish") of the given Mercure configuration.

array
mercureClaims(array $config)

Get the additional JWT claims for the given Mercure configuration.

Details

at line 30
protected Broadcaster createMercureDriver(array $config)

Create an instance of the driver.

Parameters

array $config

Return Value

Broadcaster

at line 64
HubInterface mercure(array $config)

Get a Mercure hub instance for the given configuration.

Parameters

array $config

Return Value

HubInterface

at line 113
protected bool broadcastsToSynchronousMercureConnections(mixed $event)

Determine if the given event only targets Mercure connections publishing synchronously.

Parameters

mixed $event

Return Value

bool

at line 136
protected PoolDefinition mercurePoolDefinition(array $config)

Identify the shared HTTP-client pool for construction and invalidation.

Parameters

array $config

Return Value

PoolDefinition

at line 144
protected int mercureSubscribeExpiration(array $config)

Get the subscriber token (and cookie) lifetime in whole seconds.

Parameters

array $config

Return Value

int

at line 152
protected TokenFactoryInterface|null mercureSubscribeFactory(array $config)

Get the subscriber token factory for the given Mercure configuration.

Parameters

array $config

Return Value

TokenFactoryInterface|null

at line 177
protected TokenFactoryInterface mercureTokenFactory(TokenFactoryInterface $factory, array $claims, array $config)

Add configured claims and resolve the default audience when a token is minted.

Parameters

TokenFactoryInterface $factory
array $claims
array $config

Return Value

TokenFactoryInterface

at line 196
protected ChannelEncrypter|null mercureChannelEncrypter(array $config)

Get the end-to-end channel encrypter for the given Mercure configuration.

Parameters

array $config

Return Value

ChannelEncrypter|null

at line 220
protected array mercurePublishClaims(array $config)

Get the additional JWT claims for the publisher side of the given Mercure configuration.

Parameters

array $config

Return Value

array

at line 232
protected string mercureSecret(array $config, string $side)

Get the JWT secret for the given side ("subscribe" or "publish") of the given Mercure configuration.

Parameters

array $config
string $side

Return Value

string

at line 263
protected array mercureClaims(array $config)

Get the additional JWT claims for the given Mercure configuration.

Parameters

array $config

Return Value

array