You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Promise_Base.cs
+19-4Lines changed: 19 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
-
usingSystem;
1
+
usingSystem;
2
2
usingSystem.Collections.Generic;
3
+
usingRSG.Exceptions;
3
4
usingRSG.Promises;
4
5
5
6
namespaceRSG
@@ -158,6 +159,20 @@ public interface IPromiseInfo
158
159
stringName{get;}
159
160
}
160
161
162
+
publicstructProgressHandler
163
+
{
164
+
/// <summary>
165
+
/// Callback fn.
166
+
/// </summary>
167
+
publicAction<float>callback;
168
+
169
+
/// <summary>
170
+
/// The promise that is rejected when there is an error while invoking the handler.
171
+
/// </summary>
172
+
publicIRejectablerejectable;
173
+
}
174
+
175
+
161
176
publicabstractclassPromise_Base:IPromiseInfo
162
177
{
163
178
/// <summary>
@@ -197,7 +212,7 @@ public Promise_Base()
197
212
198
213
if(Promise.EnablePromiseTracking)
199
214
{
200
-
Promise.pendingPromises.Add(this);
215
+
Promise.PendingPromises.Add(this);
201
216
}
202
217
}
203
218
@@ -273,15 +288,15 @@ public void Reject(Exception ex)
273
288
274
289
if(CurState!=PromiseState.Pending)
275
290
{
276
-
thrownewApplicationException("Attempt to reject a promise that is already in state: "+CurState+", a promise can only be rejected when it is still in state: "+PromiseState.Pending);
291
+
thrownewPromiseStateException("Attempt to reject a promise that is already in state: "+CurState+", a promise can only be rejected when it is still in state: "+PromiseState.Pending);
0 commit comments