3 ms·
can Deferred work so fast that it don't call some of callback functions because they were not added yet?
by fedd 15y ago
can Deferred work so fast that it don't call some of callback functions because they were not added yet?
- sausagefeet 15y agoNo.
- fedd 15y agoI can't understand why. Why?
- sausagefeet 15y agoFor starters since it event based nothing can happen until you give back control to event loop. Secondly if you add another callback or errback to a Deferred that has already been fired it just calls it with the last result. Note, Deferred is much simpler than I imagine you are thinking it is. It does nothing to handle events it is just a first class way to represent the flow of code.
- fedd 15y agoso adding a callback runs it if there is a result. thanks