Interface ExecutionRepository

All Known Implementing Classes:
InMemoryStores, PostgresExecutionRepository

public interface ExecutionRepository
Durable execution store using optimistic version checks for updates.
  • Method Details

    • create

      void create(EventExecution execution)
      Persists a new execution.
      Parameters:
      execution - new execution to persist
    • find

      Finds one execution.
      Parameters:
      id - execution identifier
      Returns:
      matching execution, if present
    • findDue

      Collection<EventExecution> findDue(Instant now, int limit)
      Finds runnable work due on or before a time.
      Parameters:
      now - inclusive due-time boundary
      limit - maximum results
      Returns:
      runnable executions ordered by due time when supported
    • findActive

      Collection<EventExecution> findActive(int limit)
      Finds execution state eligible for startup recovery.
      Parameters:
      limit - maximum results
      Returns:
      executions eligible for startup recovery
    • compareAndSet

      boolean compareAndSet(long expectedVersion, EventExecution replacement)
      Replaces an execution only if its current version equals the expected version.
      Parameters:
      expectedVersion - version observed by the caller
      replacement - complete replacement value
      Returns:
      whether the replacement was persisted