Interface ExecutionRepository
- All Known Implementing Classes:
InMemoryStores, PostgresExecutionRepository
public interface ExecutionRepository
Durable execution store using optimistic version checks for updates.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancompareAndSet(long expectedVersion, EventExecution replacement) Replaces an execution only if its current version equals the expected version.voidcreate(EventExecution execution) Persists a new execution.Finds one execution.findActive(int limit) Finds execution state eligible for startup recovery.Finds runnable work due on or before a time.
-
Method Details
-
create
Persists a new execution.- Parameters:
execution- new execution to persist
-
find
Finds one execution.- Parameters:
id- execution identifier- Returns:
- matching execution, if present
-
findDue
Finds runnable work due on or before a time.- Parameters:
now- inclusive due-time boundarylimit- maximum results- Returns:
- runnable executions ordered by due time when supported
-
findActive
Finds execution state eligible for startup recovery.- Parameters:
limit- maximum results- Returns:
- executions eligible for startup recovery
-
compareAndSet
Replaces an execution only if its current version equals the expected version.- Parameters:
expectedVersion- version observed by the callerreplacement- complete replacement value- Returns:
- whether the replacement was persisted
-