Class Selector

  • All Implemented Interfaces:
    WasiConstants

    public class Selector
    extends java.lang.Object
    implements WasiConstants
    WasiIO selector.
    • Constructor Detail

      • Selector

        public Selector​(java.util.List<SubscriptionIO> subIOs,
                        @Nullable
                        SubscriptionClock subTimeout,
                        WasiIORegistry ioRegistry)
        Creates a new Selector.
        Parameters:
        subIOs - the subscription I/O events.
        subTimeout - the select timeout event.
        ioRegistry - the registry used to look up a WasiIO by file descriptor.
    • Method Detail

      • select

        public int select​(byte[] memory,
                          int outEventPtr,
                          int nbOccuredEventPtr)
        Select the subscription events whose the associated files descriptors are ready.
        Parameters:
        memory - the memory to be used to write the selected event result.
        outEventPtr - the start offset in the memory to write the selected event result.
        nbOccuredEventPtr - the offset in the memory to write the number of event selected.
        Returns:
        WasiConstants.ERRNO_SUCCESS on success, or an ERRNO value on error (see WasiConstants).