Method | Description | |
---|---|---|
Dispose ( ) : void |
Releases all resource used by the SpicyPixel.Threading.Tasks.FiberTaskScheduler object. Call the method when you are finished using the SpicyPixel.Threading.Tasks.FiberTaskScheduler. The method leaves the SpicyPixel.Threading.Tasks.FiberTaskScheduler in an unusable state. After calling the method, you must release all references to the SpicyPixel.Threading.Tasks.FiberTaskScheduler so the garbage collector can reclaim the memory that the SpicyPixel.Threading.Tasks.FiberTaskScheduler was occupying. |
|
FiberTaskScheduler ( ) : System |
Initializes a new instance of the SpicyPixel.Threading.Tasks.FiberTaskScheduler class. Derived classes should invoke EnableQueueTask() in their constructor when ready to begin executing tasks. |
|
FiberTaskScheduler ( FiberScheduler scheduler ) : System |
Initializes a new instance of the SpicyPixel.Threading.Tasks.FiberTaskScheduler class. Derived classes should invoke EnableQueueTask() in their constructor when ready to begin executing tasks. |
Method | Description | |
---|---|---|
GetScheduledTasks ( ) : IEnumerable |
For debugger support only, generates an enumerable of Task instances currently queued to the scheduler waiting to be executed. This is not supported and will always return null. |
|
QueueTask ( Task task ) : void |
Queues a non-blocking task. If the task is queued from the scheduler thread it will begin executing to its first yield immediately. |
|
TryDequeue ( Task task ) : bool |
Tries to dequeue a task. Only delay start tasks can be dequeued. Although the Fiber scheduler does delay start tasks queued from a non-scheduler thread, de-queuing is not supported right now and so this method always returns |
|
TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool |
Tries to execute the task inline. Tasks executed on a fiber scheduler have thread affinity and must run on the thread the scheduler was created online. Inline execution will therefore fail if attempted from another thread besides the scheduler thread. A YieldableTask cannot run inline because yieldable tasks can only be processed by a FiberTaskScheduler when queued. Because of these restrictions, only standard non-blocking actions invoked on the scheduler thread are eligible for inlining. |
Method | Description | |
---|---|---|
Dispose ( bool disposing ) : void |
Dispose the scheduler. When the scheduler is disposed, the CancellationToken is set. |
|
ExecuteTask ( Task task ) : IEnumerator |
Execute the specified task as a coroutine.
|
|
ExecuteYieldableTask ( |
Execute the specified coroutine associated with a yieldable task. Any exceptions that occur while executing the fiber will be associated with the specified task and rethrown by the framework. |
public FiberTaskScheduler ( FiberScheduler scheduler ) : System | ||
scheduler | FiberScheduler | |
return | System |
protected GetScheduledTasks ( ) : IEnumerable |
||
return | IEnumerable |
protected QueueTask ( Task task ) : void | ||
task | Task | /// The non-blocking task to queue. /// |
return | void |
protected TryDequeue ( Task task ) : bool | ||
task | Task | /// The task to dequeue. /// |
return | bool |
protected TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool | ||
task | Task | /// The task to execute. /// |
taskWasPreviouslyQueued | bool |
/// Set to |
return | bool |