Schnittstelle SourceFuncs.OnSourceFuncsPrepareFunc

Umschließende Klasse:
SourceFuncs
Funktionsschnittstelle:
Dies ist eine funktionale Schnittstelle, die somit als Zuweisungsziel für einen Lambdaausdruck oder eine Methodenreferenz verwendet werden kann.

@FunctionalInterface public static interface SourceFuncs.OnSourceFuncsPrepareFunc
  • Methodendetails

    • onSourceFuncsPrepareFunc

      boolean onSourceFuncsPrepareFunc(CallbackHandler __self, @Nonnull Source source, @Nullable Int timeout_)
      Checks the source for readiness.

      Called before all the file descriptors are polled. If the
      source can determine that it is ready here (without waiting for the
      results of the poll call) it should return %TRUE. It can also return
      a @timeout_ value which should be the maximum timeout (in milliseconds)
      which should be passed to the poll call. The actual timeout used will
      be `-1` if all sources returned `-1`, or it will be the minimum of all
      the @timeout_ values returned which were greater than or equal to `0`.
      If the prepare function returns a timeout and the source also has a
      ready time set, then the lower of the two will be used.

      Since 2.36 this may be `NULL`, in which case the effect is as if the
      function always returns `FALSE` with a timeout of `-1`.
      Parameter:
      source - The #GSource
      timeout_ - the maximum timeout (in milliseconds) which should be passed to the poll call
      Gibt zurück:
      %TRUE if the source is ready, %FALSE otherwise