StubFiber does not use a backing thread or a thread pool for execution. Actions are added to pending lists for execution. These actions can be executed synchronously by the calling thread. This class is not thread safe and should not be used in production code. More...
Public Member Functions | |
void | Start () |
No Op More... | |
void | Dispose () |
Clears all subscriptions, scheduled, and pending actions. More... | |
void | Enqueue (Action action) |
Enqueue a single action. More... | |
IDisposable | Schedule (Action action, int firstInMs) |
Adds a scheduled action to the list. More... | |
IDisposable | ScheduleOnInterval (Action action, int firstInMs, int regularInMs) |
Adds scheduled action to list. More... | |
IDisposable | Schedule (IFiberAction action, int firstInMs) |
Adds a scheduled action to the list. More... | |
IDisposable | ScheduleOnInterval (IFiberAction action, int firstInMs, int regularInMs) |
Adds scheduled action to list. More... | |
void | ExecuteAllPendingUntilEmpty () |
Execute all actions in the pending list. If any of the executed actions enqueue more actions, execute those as well. More... | |
void | ExecuteAllPending () |
Execute all actions in the pending list. More... | |
void | ExecuteAllScheduled () |
Execute all actions in the scheduled list. More... | |
Public Member Functions inherited from ExitGames.Concurrency.Core.ISubscriptionRegistry | |
void | RegisterSubscription (IDisposable toAdd) |
Register subscription to be unsubcribed from when the fiber is disposed. /summary> param name="toAdd"> More... | |
bool | DeregisterSubscription (IDisposable toRemove) |
Public Member Functions inherited from ExitGames.Concurrency.Core.IExecutionContext | |
void | Enqueue (IFiberAction action) |
Enqueue a single action. More... | |
Properties | |
int | NumSubscriptions [get] |
List< IDisposable > | Subscriptions [get] |
All subscriptions. More... | |
List< IFiberAction > | Pending [get] |
All pending actions. More... | |
List< StubScheduledAction > | Scheduled [get] |
All scheduled actions. More... | |
bool | ExecutePendingImmediately [get, set] |
If true events will be executed immediately rather than added to the pending list. More... | |
StubFiber does not use a backing thread or a thread pool for execution. Actions are added to pending lists for execution. These actions can be executed synchronously by the calling thread. This class is not thread safe and should not be used in production code.
The class is typically used for testing asynchronous code to make it completely synchronous and deterministic.
|
inline |
Clears all subscriptions, scheduled, and pending actions.
|
inline |
|
inline |
Execute all actions in the pending list.
|
inline |
Execute all actions in the pending list. If any of the executed actions enqueue more actions, execute those as well.
|
inline |
Execute all actions in the scheduled list.
|
inline |
Adds a scheduled action to the list.
action | |
firstInMs |
Implements ExitGames.Concurrency.Core.IScheduler.
|
inline |
Adds a scheduled action to the list.
action | |
firstInMs |
Implements ExitGames.Concurrency.Core.IScheduler.
|
inline |
Adds scheduled action to list.
action | |
firstInMs | |
regularInMs |
Implements ExitGames.Concurrency.Core.IScheduler.
|
inline |
Adds scheduled action to list.
action | |
firstInMs | |
regularInMs |
Implements ExitGames.Concurrency.Core.IScheduler.
|
inline |
No Op
Implements ExitGames.Concurrency.Fibers.IFiber.
|
getset |
If true events will be executed immediately rather than added to the pending list.
|
get |
|
get |
All pending actions.
|
get |
All scheduled actions.
|
get |
All subscriptions.