Package io.karatelabs.core
Interface RunListenerFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Factory for creating per-thread RunListener instances.
Use this when listeners need thread-local state (e.g., debuggers with per-thread stack frames).
The create() method is called once per execution thread, before any features
run on that thread. Each thread gets its own listener instance.
Usage example:
Suite.of("features/")
.listenerFactory(() -> new MyPerThreadListener())
.parallel(10)
.run();
Use case: The debug adapter creates one DebugThread per execution thread, each with its own stack frames and state.
-
Method Summary
-
Method Details
-
create
RunListener create()Create a listener instance for the current thread. Called once per execution thread, before any features run on that thread.- Returns:
- a new RunListener instance for this thread
-