Class CPUExecutionContext

java.lang.Object
org.episteme.core.technical.backend.cpu.CPUExecutionContext
All Implemented Interfaces:
AutoCloseable, ExecutionContext

public class CPUExecutionContext extends Object implements ExecutionContext
CPU execution context for running operations.

This context simply executes operations directly in the calling thread.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • CPUExecutionContext

      public CPUExecutionContext()
  • Method Details

    • execute

      public <T> T execute(Operation<T> operation)
      Description copied from interface: ExecutionContext
      Executes an operation synchronously and returns the result.
      Specified by:
      execute in interface ExecutionContext
      Type Parameters:
      T - the result type
      Parameters:
      operation - the operation to execute
      Returns:
      the operation result
    • close

      public void close()
      Description copied from interface: ExecutionContext
      Releases resources associated with this context.

      This method is called automatically when used in try-with-resources.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ExecutionContext