4 ms·
By one-shot you mean dynamically enforced, right? I.e. if you invoke it a second time it will raise an exception?
by maxiepoo 7y ago
By one-shot you mean dynamically enforced, right? I.e. if you invoke it a second time it will raise an exception?
- ufo 7y agoNot exactly, since they are using a fiber API instead of one built with raw continuations. In this context, being one-shot means that there is no operation for cloning or "forking" a fiber. Each time you resume the execution of a fiber, it continues to execute until it reaches its next yield point. There is no way to go "back in time" and resume execution from a previous state of the fiber, which is what multishot coroutines or the fork system call would let you do.