quenktechnologies / potoo

Communication system for browser and Node.js apps.
Other
2 stars 0 forks source link

Abort async thread operations when they encounter errors. #76

Closed metasansana closed 3 months ago

metasansana commented 6 months ago

The actor API is async now. When an error occurs in a method like spawn it will first travel the tree to be handled. Meanwhile the await thread.spawn() method will still await the promise to be resolved. We should abort that operation once an error is encountered.

To prevent infinite loops, actors can be configured to ignore the "Aborted" error by default.

metasansana commented 3 months ago

This should be handled here: https://github.com/quenktechnologies/potoo/blob/9120d55392f439387ddae1fa11b8ae62a06c8209/src/actor/system/vm/scheduler.ts#L105