Interface PythonEventLoop

All Known Implementing Classes:
NettyPythonEventLoop

@Internal public interface PythonEventLoop
Event-loop operations required to drive Micronaut-managed Python asyncio tasks.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(Runnable runnable)
    Queue a callback for serialized execution on the loop.
    boolean
    Used to decide whether Python work can run immediately or must be queued.
    schedule(Runnable runnable, long delay, TimeUnit unit)
    Queue a callback after the requested delay using loop time.
    double
    Returns the monotonic time base exposed to Python's asyncio APIs.
  • Method Details

    • inEventLoop

      boolean inEventLoop()
      Used to decide whether Python work can run immediately or must be queued.
      Returns:
      Whether the current thread is this event-loop thread.
    • execute

      void execute(Runnable runnable)
      Queue a callback for serialized execution on the loop.
      Parameters:
      runnable - The callback.
    • schedule

      ScheduledFuture<?> schedule(Runnable runnable, long delay, TimeUnit unit)
      Queue a callback after the requested delay using loop time.
      Parameters:
      runnable - The callback.
      delay - The delay.
      unit - The delay unit.
      Returns:
      The scheduled future.
    • time

      double time()
      Returns the monotonic time base exposed to Python's asyncio APIs.
      Returns:
      Event-loop time in seconds.