@@ -109,6 +109,7 @@ public static long NextChainId()
109109 }
110110
111111 #region 勿调用(仅供代码生成器调用)
112+
112113 /// <summary>
113114 /// 将一个同步Action任务压入Actor的任务队列中执行
114115 /// </summary>
@@ -120,7 +121,7 @@ public static long NextChainId()
120121 /// <returns>返回一个Task对象,表示异步操作的完成状态</returns>
121122 public Task Enqueue ( Action work , long callChainId , bool discard = false , int timeOut = TimeOut , CancellationToken cancellationToken = default )
122123 {
123- if ( ! discard && GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
124+ if ( ! discard && GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
124125 {
125126 return default ;
126127 }
@@ -147,7 +148,7 @@ public Task Enqueue(Action work, long callChainId, bool discard = false, int tim
147148 /// <returns>返回一个Task<T/>对象,表示异步操作的完成状态和结果</returns>
148149 public Task < T > Enqueue < T > ( Func < T > work , long callChainId , bool discard = false , int timeOut = TimeOut , CancellationToken cancellationToken = default )
149150 {
150- if ( ! discard && GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
151+ if ( ! discard && GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
151152 {
152153 return default ;
153154 }
@@ -173,7 +174,7 @@ public Task<T> Enqueue<T>(Func<T> work, long callChainId, bool discard = false,
173174 /// <returns>返回一个Task对象,表示异步操作的完成状态</returns>
174175 public Task Enqueue ( Func < Task > work , long callChainId , bool discard = false , int timeOut = TimeOut , CancellationToken cancellationToken = default )
175176 {
176- if ( ! discard && GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
177+ if ( ! discard && GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
177178 {
178179 return default ;
179180 }
@@ -200,7 +201,7 @@ public Task Enqueue(Func<Task> work, long callChainId, bool discard = false, int
200201 /// <returns>返回一个Task<T/>对象,表示异步操作的完成状态和结果</returns>
201202 public Task < T > Enqueue < T > ( Func < Task < T > > work , long callChainId , bool discard = false , int timeOut = TimeOut , CancellationToken cancellationToken = default )
202203 {
203- if ( ! discard && GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
204+ if ( ! discard && GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
204205 {
205206 return default ;
206207 }
@@ -218,6 +219,7 @@ public Task<T> Enqueue<T>(Func<Task<T>> work, long callChainId, bool discard = f
218219 #endregion
219220
220221 #region 供框架底层调用(逻辑开发人员应尽量避免调用)
222+
221223 /// <summary>
222224 /// 发送无返回值的工作指令到Actor的任务队列中
223225 /// </summary>
@@ -265,7 +267,7 @@ public Task SendAsync(Action work, int timeOut = Actor.TimeOut, CancellationToke
265267 var ( needEnqueue , chainId ) = IsNeedEnqueue ( ) ;
266268 if ( needEnqueue )
267269 {
268- if ( GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
270+ if ( GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
269271 {
270272 return default ;
271273 }
@@ -297,7 +299,7 @@ public Task<T> SendAsync<T>(Func<T> work, int timeOut = Actor.TimeOut, Cancellat
297299 var ( needEnqueue , chainId ) = IsNeedEnqueue ( ) ;
298300 if ( needEnqueue )
299301 {
300- if ( GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
302+ if ( GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
301303 {
302304 return default ;
303305 }
@@ -340,7 +342,7 @@ public Task SendAsync(Func<Task> work, int timeOut = int.MaxValue, bool checkLoc
340342 var ( needEnqueue , chainId ) = IsNeedEnqueue ( ) ;
341343 if ( needEnqueue )
342344 {
343- if ( checkLock && GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
345+ if ( checkLock && GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
344346 {
345347 return default ;
346348 }
@@ -371,7 +373,7 @@ public Task<T> SendAsync<T>(Func<Task<T>> work, int timeOut = int.MaxValue, Canc
371373 var ( needEnqueue , chainId ) = IsNeedEnqueue ( ) ;
372374 if ( needEnqueue )
373375 {
374- if ( GlobalSettings . IsDebug && ! ActorLimit . AllowCall ( Id ) )
376+ if ( GlobalSettings . CurrentSetting . IsDebug && ! ActorLimit . AllowCall ( Id ) )
375377 {
376378 return default ;
377379 }
0 commit comments