Interface JobObserver<T extends JobEvent>
- Type Parameters:
T- the type of JobEvent this observer handles
- All Known Implementing Classes:
AbstractWorkflowObserver, AgentTrace, BenchmarkRace, CostLedger, DecisionTrace, EventLogger, Heart, MicrometerObserver, OpenTelemetryObserver, Stethoscope, StreamingLogObserver, SystemHealthReporter
public interface JobObserver<T extends JobEvent>
Observer interface for handling job events;
observe(T) is its one abstract method, so a
lambda is an observer. Runs in a dedicated virtual thread with isolated resources.- Since:
- 0.1 (2025-09-14)
- Author:
- Andrey Santrosyan
-
Method Summary
-
Method Details
-
getPredicate
-
observe
Process a job event. Runs in a separate virtual thread. Must handle its own resources and exceptions.- Parameters:
event- the job event to process
-
isStale
default boolean isStale()Checks if this observer should be considered stale and eligible for cleanup. Called periodically by the MessageBus cleanup mechanism.Observers can implement this to indicate when they should be automatically unsubscribed (e.g., after a period of inactivity or reaching a max event count).
- Returns:
- true if this observer is stale and should be cleaned up, false otherwise
-