ocaml-iomux icon indicating copy to clipboard operation
ocaml-iomux copied to clipboard

Add Poll.get_events

Open ezrast opened this issue 1 year ago • 0 comments

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)

ezrast avatar Aug 14 '24 05:08 ezrast