$ show sizovs/PipelinR
PipelinR is a lightweight Java library implementing the mediator/pipeline pattern for command processing. It provides a type-safe way to send commands to handlers through a configurable pipeline of middleware, supporting cross-cutting concerns like logging, validation, and transactions. The library also implements notification (event publishing) with multiple handling strategies including synchronous, asynchronous, and parallel execution modes. With zero dependencies and a focus on simplicity, it aims to help developers follow SOLID principles by replacing monolithic service classes with focused handlers.
The LLM identified 2 files worth highlighting for reuse:
A utility for resolving generic types at runtime using reflection and caching. Solves the common problem of determining the actual class of a type parameter in a generic class (e.g., finding that C is String in Handler<String>). Self-contained with no library dependencies, demonstrating sophisticated use of Java reflection, hierarchical type scanning, and efficient caching to avoid repeated computation. This component could be easily extracted and used in any Java project needing runtime generic type information.
A utility class that extends Java Streams with a foldRight (right-associative reduce) operation. Enables functional programming patterns where processing order matters, such as middleware composition where the last middleware should wrap the first. Self-contained with no dependencies beyond Java standard library, providing a clean implementation that collects the stream into a LinkedList for reverse iteration. This solves a common gap in Java's Stream API and could be reused in any project requiring right-associative stream operations.