C# 클래스 NetMud.CentralControl.Processor

Central handler for all things async and recursive
파일 보기 프로젝트 열기: SwiftAusterity/NetMud

공개 메소드들

메소드 설명
GetAllLiveTaskStatusTokens ( ) : CancellationTokenSource>.Dictionary

Get all the living task cancellation tokens

ShutdownAll ( int shutdownDelay, string shutdownAnnouncement, int shutdownAnnouncementFrequency = -1 ) : void

Cancel ALL the current loops

ShutdownLoop ( string designator, int shutdownDelay, string shutdownAnnouncement, int shutdownAnnouncementFrequency = -1 ) : void

Tries to shutdown an existing loop

StartSingeltonChainedLoop ( string designator, int rampupDelay, int cooldownDelay, int maxDuration, Func workProcess ) : void

Starts a brand new Loop

StartSingeltonLoop ( string designator, int rampupDelay, int cooldownDelay, int maxDuration, Func workProcess, Func successTailProcess = null, Func failedTailProcess = null ) : void

Starts a brand new Loop

StartSubscriptionLoop ( string designator, Func subscriberProcess, int pulseCount, bool fireOnce ) : void

Starts a brand new Loop

비공개 메소드들

메소드 설명
GetAllCurrentSubscribers ( string designator, int pulseCount, bool fireOnce ) : int>>.IList
GetCancellationToken ( string designator ) : CancellationTokenSource

Gets the token from the cache

GetLoopSubscribers ( string designator ) : int>>.IList

Gets the token from the cache

RemoveCancellationToken ( string designator ) : void

Removes a token from the cache

RemoveSubscriberList ( string designator ) : void

Removes a token from the cache

RunAnnouncements ( int shutdownDelay, string shutdownAnnouncement, int shutdownAnnouncementFrequency ) : void

Runs looped formatted messages until the timer runs out

StartLoop ( Func worker, int startDelay ) : void

Starts an endless loop

StoreCancellationToken ( string designator, CancellationTokenSource token ) : void

Store the cancel token in the cache

SubscribeToLoop ( string designator, Func subscriber, int pulseCount ) : int>>.IList

Store the cancel token in the cache

메소드 상세

GetAllLiveTaskStatusTokens() 공개 정적인 메소드

Get all the living task cancellation tokens
public static GetAllLiveTaskStatusTokens ( ) : CancellationTokenSource>.Dictionary
리턴 CancellationTokenSource>.Dictionary

ShutdownAll() 공개 정적인 메소드

Cancel ALL the current loops
public static ShutdownAll ( int shutdownDelay, string shutdownAnnouncement, int shutdownAnnouncementFrequency = -1 ) : void
shutdownDelay int In # of Seconds - how long to wait before cancelling it
shutdownAnnouncement string What to announce (string.format format) before shutting down, empty string = no announcements
shutdownAnnouncementFrequency int In # of Seconds - how often to announce the shutdown, < = 0 is only one announcement
리턴 void

ShutdownLoop() 공개 정적인 메소드

Tries to shutdown an existing loop
public static ShutdownLoop ( string designator, int shutdownDelay, string shutdownAnnouncement, int shutdownAnnouncementFrequency = -1 ) : void
designator string what the loop is called
shutdownDelay int In # of Seconds - how long to wait before cancelling it
shutdownAnnouncement string What to announce (string.format format) before shutting down, empty string = no announcements, ex "World shutting down in {0} seconds."
shutdownAnnouncementFrequency int In # of Seconds - how often to announce the shutdown, <= 0 is only one announcement
리턴 void

StartSingeltonChainedLoop() 공개 정적인 메소드

Starts a brand new Loop
public static StartSingeltonChainedLoop ( string designator, int rampupDelay, int cooldownDelay, int maxDuration, Func workProcess ) : void
designator string what the loop will be called
rampupDelay int In # of Seconds - how long to wait before performing the first operation on start
cooldownDelay int In # of Seconds - how long to wait before either shutting the loop down or recurring it
maxDuration int In # of Seconds - kill this loop after this many seconds
workProcess Func What delegate process to call for the loop
리턴 void

StartSingeltonLoop() 공개 정적인 메소드

Starts a brand new Loop
public static StartSingeltonLoop ( string designator, int rampupDelay, int cooldownDelay, int maxDuration, Func workProcess, Func successTailProcess = null, Func failedTailProcess = null ) : void
designator string what the loop will be called
rampupDelay int In # of Seconds - how long to wait before performing the first operation on start
cooldownDelay int In # of Seconds - how long to wait before either shutting the loop down or recurring it
maxDuration int In # of Seconds - kill this loop after this many seconds
workProcess Func What delegate process to call for the loop
successTailProcess Func What delegate process to call when this loop terminates in success
failedTailProcess Func What delegate process to call when this loop terminates in failure
리턴 void

StartSubscriptionLoop() 공개 정적인 메소드

Starts a brand new Loop
public static StartSubscriptionLoop ( string designator, Func subscriberProcess, int pulseCount, bool fireOnce ) : void
designator string what the loop will be called
subscriberProcess Func What delegate process to call for the loop
pulseCount int on what pulse does this fire (out of 18000)
fireOnce bool Does this fire only once or does it fire every X pulses
리턴 void