Interface Runner

All Known Implementing Classes:
MainThreadRunner, PassthroughRunner

public interface Runner
A runner runs tasks in its own thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Enqueue a task to be run in the runner's thread.
    void
    run(Runnable task)
    Run a task in the runner's thread, asap.
  • Method Details

    • run

      void run(Runnable task)
      Run a task in the runner's thread, asap.
      Parameters:
      task -
    • enqueue

      void enqueue(Runnable task)
      Enqueue a task to be run in the runner's thread. This is the same as run(Runnable) but the task will be enqueued even if the call happens in the runner's thread.

      Generally, this is useful only for special use cases, like ensuring the thread doesn't get overloaded with too many tasks all at once. Otherwise just use run(Runnable).

      Parameters:
      task -