EntityRefFactoryBuilder
in package
FinalYes
Tags
Table of Contents
Methods
- __construct() : mixed
- build() : EntityRefFactory
- handle() : self
- using() : self
- withConnectionLifecycle() : self
- Pool-backed mode: the actor borrows via `$acquire` and the pool slot is returned via `$release($conn)` on PostStop instead of `close()`.
- withConnectionSource() : self
- Dedicated-connection mode: each spawned actor owns the connection returned by `$source` and `close()`s it on PostStop. Use for fresh connections (e.g. `DriverManager::getConnection`).
- withReceiveTimeout() : self
- withReplayPolicy() : self
Methods
__construct()
public
__construct(ActorSpawner $spawner, T> $entityClass) : mixed
Parameters
- $spawner : ActorSpawner
- $entityClass : T>
build()
public
build() : EntityRefFactory
Tags
Return values
EntityRefFactoryhandle()
public
handle(Closure $commandHandler) : self
Parameters
- $commandHandler : Closure
Return values
selfusing()
public
using(EntityManagerFactory $factory) : self
Parameters
- $factory : EntityManagerFactory
Return values
selfwithConnectionLifecycle()
Pool-backed mode: the actor borrows via `$acquire` and the pool slot is returned via `$release($conn)` on PostStop instead of `close()`.
public
withConnectionLifecycle(callable(): Connection $acquire, callable(Connection): void $release) : self
Parameters
- $acquire : callable(): Connection
- $release : callable(Connection): void
Return values
selfwithConnectionSource()
Dedicated-connection mode: each spawned actor owns the connection returned by `$source` and `close()`s it on PostStop. Use for fresh connections (e.g. `DriverManager::getConnection`).
public
withConnectionSource(Closure $source) : self
Parameters
- $source : Closure
Return values
selfwithReceiveTimeout()
public
withReceiveTimeout(Duration $timeout) : self
Parameters
- $timeout : Duration
Return values
selfwithReplayPolicy()
public
withReplayPolicy(EntityReplayPolicy<string|int, T> $policy) : self
Parameters
- $policy : EntityReplayPolicy<string|int, T>