4 ms·
Is it possible to mix Evented and Blocking modes in a single Zig app? At work we write libraries that mix them. For example you might want to do CPU bound work
by orisho 6y ago
Is it possible to mix Evented and Blocking modes in a single Zig app? At work we write libraries that mix them. For example you might want to do CPU bound work in threads, while you'd want a single thread to manage IO (this thread would run in Evented mode).
At a glance, this seems not possible in Zig because it's a compiletime flag?
- kristoff_it 6y agoIt's possible. The global flag is just a convention used currently by the standard library. There still are some rough spots, but I've written a TUI chat client that uses blocking I/O when interacting with the terminal, while all other operations are evented and use async/await. We still need to nail down the interface, but there is no technical blocker.