pike
pike copied to clipboard
Async I/O for Zig
I'm getting the following errors when compiling a project that uses pike: ``` /home/duane/Projects/cleartouch/lib/pike/os/windows.zig:35:25: error: use of undeclared identifier 'c_void' @ptrCast(*const c_void, &guid), ^ /home/duane/Projects/cleartouch/lib/pike/os/windows/ws2_32.zig:82:21: error: use of undeclared identifier...
I'm struggling to create what seems like should be a very basic use of pike: listen to two file descriptors, and if anything is read, print it out (without blocking)....
feedback welcome!
`pike.init()` / `pike.deinit()` are only used to initialize winsock2 on Windows. A global atomic counter may be used to silently initialize winsock2 upon the very first `Socket.init()` call, and silently...
As of right now, `Socket.get()` and `Socket.set()` assume that the level parameter which is passed to `getsockopt()` / `setsockopt()` os `SOL_SOCKET`. However, there exist other options that don't necessarily assume...
This is just an idea so far, though the idea is that for each exposed syscall (e.g. `read()`), there would be two variants: `Socket.read(buf: []u8) !usize`, and `Socket.readAsync(buf: []u8) callconv(.Async)...
Sockets on Windows are represented by a `ws2_32.SOCKET`, unlike generic file handles which are represented by `windows.HANDLE`. To cleanup all the verbose `@ptrCast(ws2_32.SOCKET, self.handle.inner)` casts in `socket_windows.zig`, it would be...
`PackedWaker` / `PackedList` in `waker.zig` was quickly written and could possibly be improved. It takes a `Set` which is a packed struct of booleans representative of a bitset. The `PackedWaker`...
Pike right now has three configurable build flags: - `pike_task`: struct type representing an asynchronous task. - `pike_batch` struct type representing a batch of asynchronous tasks. - `pike_notifier` struct type...
Error sets should be well-defined with the documentation for methods of `Socket` across platforms. Unit tests should be written to also demonstrate that behavior across platforms for the intersection set...