Replies: 2 comments 2 replies
-
TryReset resets the internal Timer, and if Canceled, TryReset will not succeed and cannot be reused. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Even in .Net 6, TryReset fails to reset the cancelation if the source was already canceled. I wrote my own CancelationToken that uses object pooling to achieve zero alloc. Check it out in my ProtoPromise library. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
UniTask is really awesome to have reached successfully zero alloc, and I would like to stick on this way by having zero allocation with the use of CancellationTokenSource. It is kind of really important since it has its place in most of methods using UniTask.
I think using a pool could be great. However, since there is no way to reset the CancellationTokenSource (TryReset not being accessible in Unity), I would like to know if someone has found a way to get around this.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions