class ConcurrencyManager extends MultipleInstanceManager mixin Driver (View source)

Properties

protected Application $app

The application instance.

from  MultipleInstanceManager
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

void
__construct(Application $app)

Create a new manager instance.

string
getDefaultInstance()

Get the default instance name.

void
setDefaultInstance(string $name)

Set the default instance name.

array
getInstanceConfig(string $name)

Get the instance specific configuration.

mixed
instance(string|null $name = null)

Get an instance by name.

mixed
get(string $name)

Attempt to get an instance from the local cache.

mixed
resolve(string $name)

Resolve the given instance.

mixed
callCustomCreator(array $config)

Call a custom instance creator.

$this
forgetInstance(array|string|null $name = null)

Unset the given instances.

void
purge(string|null $name = null)

Disconnect the given instance and remove from local cache.

$this
extend(string $name, Closure $callback)

Register a custom instance creator Closure.

$this
setApplication(Application $app)

Set the application instance used by the manager.

mixed
__call(string $method, array $parameters)

Dynamically call the default instance.

mixed
driver(string|null $name = null)

Get a driver instance by name.

createProcessDriver(array $config)

Create an instance of the process concurrency driver.

createForkDriver(array $config)

Create an instance of the fork concurrency driver.

createSyncDriver(array $config)

Create an instance of the sync concurrency driver.

Details

void __construct(Application $app)

Create a new manager instance.

Parameters

Application $app

Return Value

void

string getDefaultInstance()

Get the default instance name.

Return Value

string

void setDefaultInstance(string $name)

Set the default instance name.

Parameters

string $name

Return Value

void

array getInstanceConfig(string $name)

Get the instance specific configuration.

Parameters

string $name

Return Value

array

mixed instance(string|null $name = null)

Get an instance by name.

Parameters

string|null $name

Return Value

mixed

protected mixed get(string $name)

Attempt to get an instance from the local cache.

Parameters

string $name

Return Value

mixed

protected mixed resolve(string $name)

Resolve the given instance.

Parameters

string $name

Return Value

mixed

Exceptions

InvalidArgumentException
RuntimeException

protected mixed callCustomCreator(array $config)

Call a custom instance creator.

Parameters

array $config

Return Value

mixed

$this forgetInstance(array|string|null $name = null)

Unset the given instances.

Parameters

array|string|null $name

Return Value

$this

void purge(string|null $name = null)

Disconnect the given instance and remove from local cache.

Parameters

string|null $name

Return Value

void

$this extend(string $name, Closure $callback)

Register a custom instance creator Closure.

Parameters

string $name
Closure $callback

Return Value

$this

$this setApplication(Application $app)

Set the application instance used by the manager.

Parameters

Application $app

Return Value

$this

mixed __call(string $method, array $parameters)

Dynamically call the default instance.

Parameters

string $method
array $parameters

Return Value

mixed

mixed driver(string|null $name = null)

Get a driver instance by name.

Parameters

string|null $name

Return Value

mixed

ProcessDriver createProcessDriver(array $config)

Create an instance of the process concurrency driver.

Parameters

array $config

Return Value

ProcessDriver

ForkDriver createForkDriver(array $config)

Create an instance of the fork concurrency driver.

Parameters

array $config

Return Value

ForkDriver

Exceptions

RuntimeException

SyncDriver createSyncDriver(array $config)

Create an instance of the sync concurrency driver.

Parameters

array $config

Return Value

SyncDriver