ocaml-iomux
ocaml-iomux copied to clipboard
Add Poll.get_events
This adds get_events to complement get_fd and get_revents.
The motivation is to allow for copying an entry over another, so that iomux's array can be kept contiguous by only ever invalidating the highest-index element:
let swap_invalidate iomux size idx =
let open Iomux.Poll in
size := ((!size) - 1);
set_index iomux idx (get_fd iomux (!size)) (get_events iomux (!size));
invalidate_index iomux (!size)