Hub
class Hub extends PoolProxy implements RemoteHubInterface
Keep a publishing client's network state exclusive to its current coroutine.
Properties
| protected string | $cookieName |
Methods
Create a hub backed by reusable HTTP clients.
Invoke a synchronous method on a borrowed object.
Apply proxy-held state to a freshly borrowed object.
Get the publishing URL for the current request or application origin.
Get the public URL for the current request or application origin.
Get the publisher token provider.
Get the subscriber token factory.
Get the Mercure protocol version.
Get the subscriber authorization cookie name.
Publish an update while holding its HTTP client through response consumption.
Details
at line 34
__construct(PoolDefinition $definition, Closure $createClient, Factory $pools, UrlGenerator $urls, string $url, TokenProviderInterface $jwtProvider, TokenFactoryInterface|null $jwtFactory = null, string|null $publicUrl = null, string|null $cookieName = null)
Create a hub backed by reusable HTTP clients.
in
PoolProxy at line 29
protected ObjectPool
pool()
Resolve the current pool for this proxy's definition.
in
PoolProxy at line 55
protected mixed
invoke(string $method, array $arguments)
Invoke a synchronous method on a borrowed object.
in
PoolProxy at line 73
protected void
configureBorrowed(object $object)
Apply proxy-held state to a freshly borrowed object.
in
PoolProxy at line 80
PoolDefinition
getDefinition()
Get this proxy's immutable pool definition.
in
PoolProxy at line 88
string
getPoolName()
Return the pool's fully qualified registry name.
in
PoolProxy at line 96
bool
invalidatePool()
Remove and close this proxy's current shared pool.
at line 53
string
getUrl()
Get the publishing URL for the current request or application origin.
at line 61
string
getPublicUrl()
Get the public URL for the current request or application origin.
at line 69
TokenProviderInterface
getProvider()
Get the publisher token provider.
at line 77
TokenFactoryInterface|null
getFactory()
Get the subscriber token factory.
at line 85
ProtocolVersion
getProtocolVersion()
Get the Mercure protocol version.
at line 93
string
getCookieName()
Get the subscriber authorization cookie name.
at line 101
string
publish(Update $update)
Publish an update while holding its HTTP client through response consumption.