zf currently uses a blocking read loop for inputs. This keeps zf very efficient - if there is nothing to read, then zf is waiting on the kernel to wake it up. But the current implementation only waits on reading from the tty file descriptor.
I have two features I want to implement that depend on an event loop:
I'm not yet sure how I want to do this. Using kqueue / epoll directly isn't much work, so perhaps I will just roll my own. There is also a std.io.poll in the next Zig version that could work. Perhaps I will rely on a library like https://github.com/mitchellh/libxev or libuv.
I did a little more research on this, I think I'm going to use kqueue and epoll directly. This gives me full control, but doesn't require pulling in a library.
zf currently uses a blocking read loop for inputs. This keeps zf very efficient - if there is nothing to read, then zf is waiting on the kernel to wake it up. But the current implementation only waits on reading from the tty file descriptor.
I have two features I want to implement that depend on an event loop:
I'm not yet sure how I want to do this. Using
kqueue / epoll
directly isn't much work, so perhaps I will just roll my own. There is also astd.io.poll
in the next Zig version that could work. Perhaps I will rely on a library like https://github.com/mitchellh/libxev or libuv.