| 01:29 | <Steve Hicks> | RGN just mentioned the idea that "all async iterator cleanup solutions are isomorphic to each other" e.g. resolving a promise when it's done - but this reminds me of a discussion I brought up earlier about using promises to simulate events - when async context is involved, the isomorphism potentially breaks down if you want the cleanup to happen in the same context as the job itself... |
| 01:39 | <Chengzhong Wu> | The simulation of events with promise is not an exact simulation though, particularly about the execution time of the handlers. Promises forces deferral of the handler execution time. Another common pitfall is that event.preventDefault() does not work after await |
| 03:35 | <Steve Hicks> | sorry, I don't mean general-purpose event simulation - but exposing event-like things using promises instead of events because it's a nicer API to code against. But the mismatch as I see it is that "event-like" things want dispatch context and promises hide that context. Same situation potentially with these async iteration cleanups - choosing to expose it via a promise may be "isomorphic" in some senses, but with AsyncContext in the mix, it has very real differences. |