Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.QuantumRunnerRegistry Class Reference

A registry to keep track of all active Quantum runners. More...

Public Member Functions

void AddRunner (SessionRunner runner)
 Add a runner. More...
 
SessionRunner FindRunner (IDeterministicGame game)
 Find a runner by SessionRunner.DeterministicGame. More...
 
SessionRunner FindRunner (string id)
 Find a runner by SessionRunner.Id. More...
 
void RemoveRunner (SessionRunner runner)
 Remove a runner. More...
 
void ShutdownAll ()
 Calls SessionRunner.Shutdown(ShutdownCause) on all runners. More...
 
System.Threading.Tasks.Task ShutdownAllAsync ()
 Calls SessionRunner.WaitForShutdownAsync(System.Threading.CancellationToken) on all runners."/> More...
 

Public Attributes

IEnumerable< SessionRunnerActiveRunners => _activeRunners
 Returns all runners. More...
 
SessionRunner Default => _activeRunners.Count == 0 ? default : _activeRunners[0]
 The default runner. More...
 

Properties

static QuantumRunnerRegistry Global [get]
 Singleton instance of the registry. Creates a new instance if none exists. More...
 

Detailed Description

A registry to keep track of all active Quantum runners.

Member Function Documentation

◆ ShutdownAll()

void Quantum.QuantumRunnerRegistry.ShutdownAll ( )
inline

◆ ShutdownAllAsync()

System.Threading.Tasks.Task Quantum.QuantumRunnerRegistry.ShutdownAllAsync ( )
inline

Calls SessionRunner.WaitForShutdownAsync(System.Threading.CancellationToken) on all runners."/>

◆ AddRunner()

void Quantum.QuantumRunnerRegistry.AddRunner ( SessionRunner  runner)
inline

Add a runner.

◆ RemoveRunner()

void Quantum.QuantumRunnerRegistry.RemoveRunner ( SessionRunner  runner)
inline

Remove a runner.

◆ FindRunner() [1/2]

SessionRunner Quantum.QuantumRunnerRegistry.FindRunner ( string  id)
inline

Find a runner by SessionRunner.Id.

Parameters
idRunner id to search.
Returns
The runner with the given id or null.

◆ FindRunner() [2/2]

SessionRunner Quantum.QuantumRunnerRegistry.FindRunner ( IDeterministicGame  game)
inline

Find a runner by SessionRunner.DeterministicGame.

Parameters
gameThe game that the runner belongs to.
Returns
The runner with the given game or null.

Member Data Documentation

◆ Default

SessionRunner Quantum.QuantumRunnerRegistry.Default => _activeRunners.Count == 0 ? default : _activeRunners[0]

The default runner.

If multiple runners exists it will return the first one.

◆ ActiveRunners

IEnumerable<SessionRunner> Quantum.QuantumRunnerRegistry.ActiveRunners => _activeRunners

Returns all runners.

Property Documentation

◆ Global

QuantumRunnerRegistry Quantum.QuantumRunnerRegistry.Global
staticget

Singleton instance of the registry. Creates a new instance if none exists.