C# 클래스 SpicyPixel.Threading.FiberScheduler

Schedules fibers for execution.
Schedulers are bound to the thread they are created on and they install a SynchronizationContext which is active during execution. Schedulers have an implementation specific update method or run loop. The interface is otherwise thin since schedulers are generally not intended to be used directly. Scheduling work is accomplished by invoking methods on Fiber or SynchronizationContext.
상속: IFiberScheduler, IDisposable
파일 보기 프로젝트 열기: spicypixel/concurrency-kit-cs 1 사용 예제들

Private Properties

프로퍼티 타입 설명
IFiberScheduler void
SetCurrentScheduler void

공개 메소드들

메소드 설명
Dispose ( ) : void

Releases all resource used by the SpicyPixel.Threading.FiberScheduler object.

Call the method when you are finished using the SpicyPixel.Threading.FiberScheduler. The method leaves the SpicyPixel.Threading.FiberScheduler in an unusable state. After calling the method, you must release all references to the SpicyPixel.Threading.FiberScheduler so the garbage collector can reclaim the memory that the SpicyPixel.Threading.FiberScheduler was occupying.

Run ( ) : void

Run the blocking scheduler loop and perform the specified number of updates per second.

Not all schedulers support a blocking run loop that can be invoked by the caller.

Run ( CancellationToken token, float updatesPerSecond = 0f ) : void

Run the blocking scheduler loop and perform the specified number of updates per second.

Not all schedulers support a blocking run loop that can be invoked by the caller.

Run ( Fiber fiber ) : void

Run the blocking scheduler loop and perform the specified number of updates per second.

Not all schedulers support a blocking run loop that can be invoked by the caller.

Run ( Fiber fiber, CancellationToken token, float updatesPerSecond = 0f ) : void

Run the blocking scheduler loop and perform the specified number of updates per second.

Not all schedulers support a blocking run loop that can be invoked by the caller.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Dispose the scheduler.

When the scheduler is disposed, the CancellationToken is set.

ExecuteFiber ( Fiber fiber ) : FiberInstruction

Executes the fiber until it ends or yields.

Custom schedulers will need to invoke this method in order to actually perform the work of the fiber and cause the correct state transitions to occur.

FiberScheduler ( ) : System

Initializes a new instance of the SpicyPixel.Threading.FiberScheduler class.

QueueFiber ( Fiber fiber ) : void

Queues the fiber for execution on the scheduler.

Fibers queued from the scheduler thread will generally be executed inline whenever possible on most schedulers.

비공개 메소드들

메소드 설명
IFiberScheduler ( Fiber fiber ) : void
SetCurrentScheduler ( FiberScheduler scheduler, bool internalInvoke ) : void

메소드 상세

Dispose() 공개 메소드

Releases all resource used by the SpicyPixel.Threading.FiberScheduler object.
Call the method when you are finished using the SpicyPixel.Threading.FiberScheduler. The method leaves the SpicyPixel.Threading.FiberScheduler in an unusable state. After calling the method, you must release all references to the SpicyPixel.Threading.FiberScheduler so the garbage collector can reclaim the memory that the SpicyPixel.Threading.FiberScheduler was occupying.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Dispose the scheduler.
When the scheduler is disposed, the CancellationToken is set.
protected Dispose ( bool disposing ) : void
disposing bool /// Disposing is true when called manually, /// false when called by the finalizer. ///
리턴 void

ExecuteFiber() 보호된 메소드

Executes the fiber until it ends or yields.
Custom schedulers will need to invoke this method in order to actually perform the work of the fiber and cause the correct state transitions to occur.
protected ExecuteFiber ( Fiber fiber ) : FiberInstruction
fiber Fiber /// The fiber to execute. ///
리턴 FiberInstruction

FiberScheduler() 보호된 메소드

Initializes a new instance of the SpicyPixel.Threading.FiberScheduler class.
protected FiberScheduler ( ) : System
리턴 System

QueueFiber() 보호된 추상적인 메소드

Queues the fiber for execution on the scheduler.
Fibers queued from the scheduler thread will generally be executed inline whenever possible on most schedulers.
protected abstract QueueFiber ( Fiber fiber ) : void
fiber Fiber /// The fiber to queue. ///
리턴 void

Run() 공개 메소드

Run the blocking scheduler loop and perform the specified number of updates per second.
Not all schedulers support a blocking run loop that can be invoked by the caller.
public Run ( ) : void
리턴 void

Run() 공개 메소드

Run the blocking scheduler loop and perform the specified number of updates per second.
Not all schedulers support a blocking run loop that can be invoked by the caller.
public Run ( CancellationToken token, float updatesPerSecond = 0f ) : void
token System.Threading.CancellationToken /// A cancellation token that can be used to stop execution. ///
updatesPerSecond float /// Updates to all fibers per second. A value of 0 (the default) will execute fibers /// any time they are ready to do work instead of waiting to execute on a specific frequency. ///
리턴 void

Run() 공개 메소드

Run the blocking scheduler loop and perform the specified number of updates per second.
Not all schedulers support a blocking run loop that can be invoked by the caller.
public Run ( Fiber fiber ) : void
fiber Fiber /// The initial fiber to start on the scheduler. ///
리턴 void

Run() 공개 메소드

Run the blocking scheduler loop and perform the specified number of updates per second.
Not all schedulers support a blocking run loop that can be invoked by the caller.
public Run ( Fiber fiber, CancellationToken token, float updatesPerSecond = 0f ) : void
fiber Fiber /// The optional fiber to start execution from. If this is null, the loop /// will continue to execute until cancelled. Otherwise, the loop will terminate /// when the fiber terminates. ///
token System.Threading.CancellationToken /// A cancellation token that can be used to stop execution. ///
updatesPerSecond float /// Updates to all fibers per second. A value of 0 (the default) will execute fibers /// any time they are ready to do work instead of waiting to execute on a specific frequency. ///
리턴 void