Photon Server API

Public Member Functions | Properties | List of all members
ExitGames.Threading.Timer Class Reference

This class is a manager for scheduled callbacks. More...

Public Member Functions

 Timer ()
 Initializes a new instance of the Timer class. More...
 
Guid AddAction (DateTime utcExecutionTime, Action callback)
 Schedules a callback for a specific time. More...
 
void ClearActions ()
 Aborts all timers. More...
 
void ExecuteAction (Action callback)
 Immediately invoks an async callback. More...
 
void RemoveAction (Guid id)
 Removes a scheduled action that has been added with AddAction. More...
 
void Start ()
 Start executing callbacks. More...
 
void Stop ()
 Stops all timers. More...
 

Properties

bool Running [get]
 Gets a value indicating whether Running. More...
 

Detailed Description

This class is a manager for scheduled callbacks.

Constructor & Destructor Documentation

◆ Timer()

ExitGames.Threading.Timer.Timer ( )
inline

Initializes a new instance of the Timer class.

Member Function Documentation

◆ AddAction()

Guid ExitGames.Threading.Timer.AddAction ( DateTime  utcExecutionTime,
Action  callback 
)
inline

Schedules a callback for a specific time.

Parameters
utcExecutionTimeThe execution time in UTC.
callbackThe callback.
Returns
An ID that can be used to abort the timer with RemoveAction.

◆ ClearActions()

void ExitGames.Threading.Timer.ClearActions ( )
inline

Aborts all timers.

◆ ExecuteAction()

void ExitGames.Threading.Timer.ExecuteAction ( Action  callback)
inline

Immediately invoks an async callback.

Parameters
callbackThe callback to invoke.

◆ RemoveAction()

void ExitGames.Threading.Timer.RemoveAction ( Guid  id)
inline

Removes a scheduled action that has been added with AddAction.

Parameters
idThe action id assigned by AddAction.

◆ Start()

void ExitGames.Threading.Timer.Start ( )
inline

Start executing callbacks.

◆ Stop()

void ExitGames.Threading.Timer.Stop ( )
inline

Stops all timers.

Property Documentation

◆ Running

bool ExitGames.Threading.Timer.Running
get

Gets a value indicating whether Running.