def wait(timeout = -1)
      @readables = []
      @writables = []
      @event_masks = {}

      if event = @poller.wait(timeout)
        extract(event)

        # get all other pending events, if any, but no more blocking
        while event = @poller.wait(0)
          extract(event)
        end

        restore_event_masks
        return true
      end
      return false
    end
def wait(timeout = -1)
      @readables = []
      @writables = []
      @event_masks = {}

      if event = @poller.wait(timeout)
        extract(event)

        # get all other pending events, if any, but no more blocking
        while event = @poller.wait(0)
          extract(event)
        end

        restore_event_masks
        return true
      end
      return false
    end
Initializes the aggregated poller.
 @param poller [CZTop::Poller] the wrapped poller
 Forgets all previous event information (which sockets are
 readable/writable) and waits for events anew. After getting the first
 event, {CZTop::Poller#wait} is called again with a zero-timeout to get
 all pending events to extract them into the aggregated lists of
 readable and writable sockets.

 For every event, the corresponding event mask flag is disabled for the
 associated socket, so it won't turn up again. Finally, all event masks
 are restored to what they were before the call to this method.

 @param timeout [Integer] how long to wait in ms, or 0 to avoid blocking,
   or -1 to wait indefinitely
 @return [Boolean] whether there have been any events