microsoft / essex-toolkit

Provides a set of useful tools, utilities, reusable components, and React hooks that are designed to capture common components and utilities common among Essex Alpha team projects.
https://microsoft.github.io/essex-toolkit/
MIT License
19 stars 7 forks source link

Improved Async Support #254

Closed darthtrevino closed 3 months ago

darthtrevino commented 3 months ago

The existing handle_async directive used asyncio.run, which precluded using an outer event loop. Instead of unrolling async into sync, this PR handles async functions by detecting first if they are awaitable, and then by introducing synchronization methods on Node and Graph interfaces to drain the event queue.