Cluster
in package
A cluster is a collection of applications that this spitfire instance is managing.
Tags
Table of Contents
- $apps : Collection<string|int, App>
- Contains the underlying collection of applications that the cluster is managing.
- __construct() : mixed
- Instances a new cluster. The cluster allows the application access to the apps that this spitfire instance is managing.
- findByNamespace() : App|null
- Looks for an App based on the namespace provided. A namespace can also be a classname here. The cluster will return the application that is in charge of managing the class you provided.
- get() : App
- Returns the selected app from spitfire.
- has() : bool
- Returns whether there is already an application registered with the cluster.
- put() : mixed
- Add an application to the cluster
- remove() : void
- This is a weird scenario, it's rarely useful to remove an application you just loaded from the cluster. This is mostly used to implement safe-mode style operations.
Properties
$apps
Contains the underlying collection of applications that the cluster is managing.
private
Collection<string|int, App>
$apps
Methods
__construct()
Instances a new cluster. The cluster allows the application access to the apps that this spitfire instance is managing.
public
__construct() : mixed
Apps are referenced by their name (often still referenced as URL space, since they are often equivalent) and need to be unique.
Return values
mixed —findByNamespace()
Looks for an App based on the namespace provided. A namespace can also be a classname here. The cluster will return the application that is in charge of managing the class you provided.
public
findByNamespace(string $namespace) : App|null
If the class is not part of any application, you will receive a null return value here.
NOTE: This method's API is potentially unstable, since it currently assumes that only one instance of an application can be run at a time in a spitfire cluster. This is open for change, allowing a developer to deploy the same application multiple times with different settings.
Parameters
- $namespace : string
Return values
App|null —get()
Returns the selected app from spitfire.
public
get(string $name) : App
Parameters
- $name : string
Tags
Return values
App —has()
Returns whether there is already an application registered with the cluster.
public
has(string $name) : bool
Parameters
- $name : string
Return values
bool —put()
Add an application to the cluster
public
put(App $app) : mixed
Parameters
- $app : App
Return values
mixed —remove()
This is a weird scenario, it's rarely useful to remove an application you just loaded from the cluster. This is mostly used to implement safe-mode style operations.
public
remove(string $name) : void
Parameters
- $name : string