webx-net / webx

A DSL and framework for hypermedia driven web backends, and REST APIs
https://webx.sh
6 stars 1 forks source link

Async runtime event loop #1

Closed WilliamRagstad closed 8 months ago

WilliamRagstad commented 9 months ago

Implement an asynchronous runtime in the currently non-optimized concurrent runtime entry point: https://github.com/webx-net/webx/blob/62e405e8e75440d4ff7214d1252eeb59ff219798/src/engine/runtime.rs#L678-L703

The idea is that the whole thread is currently blocked when the handle_request is running. Both the handle_request function and all IO operations should be async, thus allowing the following to dispatch an asynchronous call and move on to listening to new incoming requests. https://github.com/webx-net/webx/blob/62e405e8e75440d4ff7214d1252eeb59ff219798/src/engine/runtime.rs#L746-L752

Possible implementations may use:

The goal is to optimize the runtime run function and event loop thread. so that it can handle multiple ongoing requests concurrently in the same thread.