You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) !usize.
Another method would be exposed, which is Socket.wait(.{ .read = ?, .write = ? }) callconv(.Async) void which allows users to manually await until a read/write-readiness notification is provided by an I/O notifier for a given file handle.
Calling Socket.read(...) will return immediately if the syscall cannot immediately be completed, and thus may be driven by Socket.wait(.{ .read = true }). Calling Socket.readAsync(...) will automatically retry the syscall, which is done by awaiting for readiness notifications from an I/O notifier via Socket.wait(.{ .read = true }).
Exposing these two variants also allows for Socket's in pike to be used in blocking mode (e.g. read() / write() may be called directly, blocking the current thread until said read() / write() is completed).
The text was updated successfully, but these errors were encountered:
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
, andSocket.readAsync(buf: []u8) callconv(.Async) !usize
.Another method would be exposed, which is
Socket.wait(.{ .read = ?, .write = ? }) callconv(.Async) void
which allows users to manually await until a read/write-readiness notification is provided by an I/O notifier for a given file handle.Calling
Socket.read(...)
will return immediately if the syscall cannot immediately be completed, and thus may be driven bySocket.wait(.{ .read = true })
. CallingSocket.readAsync(...)
will automatically retry the syscall, which is done by awaiting for readiness notifications from an I/O notifier viaSocket.wait(.{ .read = true })
.Exposing these two variants also allows for
Socket
's in pike to be used in blocking mode (e.g.read()
/write()
may be called directly, blocking the current thread until saidread()
/write()
is completed).The text was updated successfully, but these errors were encountered: