compio-rs / compio

A thread-per-core Rust runtime with IOCP/io_uring/polling.
MIT License
420 stars 37 forks source link

feat: make `Runtime` public #141

Closed Berrysoft closed 11 months ago

Berrysoft commented 11 months ago

It's a little painful to force the users to use a thread local runtime, especially when dropping it. We need to expose the runtime type. This makes some logic a bit more complex. Here I write a guard type EnterGuard to control the "current" runtime. Attacher will also check if the attached runtime is the current runtime.