ConcurrencyManager
class ConcurrencyManager extends MultipleInstanceManager mixin Driver
Traits
Properties
| protected Repository | $config | The configuration repository instance. |
from MultipleInstanceManager |
| protected array | $instances | The array of resolved instances. |
from MultipleInstanceManager |
| protected array | $customCreators | The registered custom instance creators. |
from MultipleInstanceManager |
| protected string | $driverKey | The key name of the "driver" equivalent configuration option. |
from MultipleInstanceManager |
Methods
Get the default instance name.
Set the default concurrency driver name.
Get the instance specific configuration.
Attempt to get an instance from the local cache.
Unset the given instances.
Disconnect the given instance and remove from local cache.
Dynamically call the default instance.
Get a driver instance by name.
Create an instance of the coroutine concurrency driver.
Create an instance of the process concurrency driver.
Create an instance of the sync concurrency driver.
No description
Details
in
RebindsCallbacksToSelf at line 18
protected Closure|null
bindCallbackToSelf(Closure $callback)
Bind the provided callback to the class instance.
in
MultipleInstanceManager at line 44
__construct(Application $app)
Create a new manager instance.
at line 68
string
getDefaultInstance()
Get the default instance name.
at line 78
void
setDefaultInstance(string $name)
Set the default concurrency driver name.
Mutates process-global config; per-request use races across coroutines.
at line 87
array
getInstanceConfig(string $name)
Get the instance specific configuration.
in
MultipleInstanceManager at line 72
mixed
instance(string|null $name = null)
Get an instance by name.
in
MultipleInstanceManager at line 84
protected mixed
get(string $name)
Attempt to get an instance from the local cache.
in
MultipleInstanceManager at line 95
protected mixed
resolve(string $name)
Resolve the given instance.
in
MultipleInstanceManager at line 127
protected mixed
callCustomCreator(array $config)
Call a custom instance creator.
in
MultipleInstanceManager at line 141
MultipleInstanceManager
forgetInstance(array|string|null $name = null)
Unset the given instances.
Mutates the singleton's instance cache; concurrent coroutines may already hold a reference to the forgotten instance and next resolution will rebuild.
in
MultipleInstanceManager at line 162
void
purge(string|null $name = null)
Disconnect the given instance and remove from local cache.
Mutates the singleton's instance cache; concurrent coroutines may already hold a reference to the instance and next resolution will rebuild.
in
MultipleInstanceManager at line 181
MultipleInstanceManager
extend(string $name, Closure $callback)
Register a custom instance creator Closure.
Anonymous closures run in this manager's class scope; non-static closures also receive the manager as $this.
The callback persists in the singleton's customCreators array for the worker lifetime and applies to every subsequent instance resolution.
in
MultipleInstanceManager at line 205
MultipleInstanceManager
setApplication(Application $app)
Set the application instance used by the manager.
Swaps the singleton's application and configuration references without rebuilding resolved instances; per-request use races across coroutines and breaks every concurrent resolution through this manager.
in
MultipleInstanceManager at line 217
mixed
__call(string $method, array $parameters)
Dynamically call the default instance.
at line 29
mixed
driver(UnitEnum|string|null $name = null)
Get a driver instance by name.
at line 41
CoroutineDriver
createCoroutineDriver()
Create an instance of the coroutine concurrency driver.
at line 49
ProcessDriver
createProcessDriver()
Create an instance of the process concurrency driver.
at line 60
SyncDriver
createSyncDriver()
Create an instance of the sync concurrency driver.
at line 22
array
run(Closure|array $tasks, CarbonInterval|int|null $timeout = 'null')
No description