Quantum 3 3.1.0

Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Photon.Realtime.AsyncConfig Class Reference

The Photon Realtime async extension configuration is used in all async calls and will use the Global if not explicitly set. More...

Static Public Member Functions

static AsyncConfig CreateUnityAsyncConfig ()
 Creates a config that works in Unity: only runs tasks on the main thread plus a CancellationSource. More...
 
static TaskFactory CreateUnityTaskFactory ()
 Create a task factory that work in Unity: only runs tasks on the main thread. More...
 
static void InitForUnity ()
 Set the Global config to work with Unity. More...
 

Public Attributes

bool IsCancellationRequested => CancellationToken.IsCancellationRequested
 Is the cancellation requested. More...
 

Static Public Attributes

static AsyncConfig Global = new AsyncConfig()
 The global async config used by all async calls if no explicit config is passed. More...
 

Properties

CancellationToken CancellationToken [get, set]
 A cancellation token that is used by default in Photon Realtime async tasks and can be used to globally cancel everything. More...
 
bool CreateServiceTask = true [get, set]
 Runs client.Service() during the operation. More...
 
float OperationTimeoutSec = 15.0f [get, set]
 Timeout for operations will cause a OperationCanceled exception. More...
 
int ServiceIntervalMs = 10 [get, set]
 Update interval of the ServiceTask More...
 
TaskFactory TaskFactory = Task.Factory [get, set]
 Customize the task factory. Default is Task.Factory. More...
 
TaskScheduler? TaskScheduler [get]
 Get the task scheduler from the TaskFactory, otherwise TaskScheduler.Default. More...
 

Detailed Description

The Photon Realtime async extension configuration is used in all async calls and will use the Global if not explicitly set.

Member Function Documentation

◆ InitForUnity()

static void Photon.Realtime.AsyncConfig.InitForUnity ( )
inlinestatic

Set the Global config to work with Unity.

◆ CreateUnityAsyncConfig()

static AsyncConfig Photon.Realtime.AsyncConfig.CreateUnityAsyncConfig ( )
inlinestatic

Creates a config that works in Unity: only runs tasks on the main thread plus a CancellationSource.

Returns
AsyncConfig

◆ CreateUnityTaskFactory()

static TaskFactory Photon.Realtime.AsyncConfig.CreateUnityTaskFactory ( )
inlinestatic

Create a task factory that work in Unity: only runs tasks on the main thread.

Returns
AsyncConfig

Member Data Documentation

◆ Global

AsyncConfig Photon.Realtime.AsyncConfig.Global = new AsyncConfig()
static

The global async config used by all async calls if no explicit config is passed.

◆ IsCancellationRequested

bool Photon.Realtime.AsyncConfig.IsCancellationRequested => CancellationToken.IsCancellationRequested

Is the cancellation requested.

Property Documentation

◆ CreateServiceTask

bool Photon.Realtime.AsyncConfig.CreateServiceTask = true
getset

Runs client.Service() during the operation.

◆ ServiceIntervalMs

int Photon.Realtime.AsyncConfig.ServiceIntervalMs = 10
getset

Update interval of the ServiceTask

◆ OperationTimeoutSec

float Photon.Realtime.AsyncConfig.OperationTimeoutSec = 15.0f
getset

Timeout for operations will cause a OperationCanceled exception.

◆ TaskFactory

TaskFactory Photon.Realtime.AsyncConfig.TaskFactory = Task.Factory
getset

Customize the task factory. Default is Task.Factory.

◆ TaskScheduler

TaskScheduler? Photon.Realtime.AsyncConfig.TaskScheduler
get

Get the task scheduler from the TaskFactory, otherwise TaskScheduler.Default.

◆ CancellationToken

CancellationToken Photon.Realtime.AsyncConfig.CancellationToken
getset

A cancellation token that is used by default in Photon Realtime async tasks and can be used to globally cancel everything.