Skip to content

RajMandaliya/Async-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Pipeline (Rust)

A composable, async-first pipeline for candidate processing:

sourcing → hydration → filtering → scoring → selection → side effects

Designed to be modular, testable, and concurrency-friendly.


Motivation

This project explores a clean architecture for building asynchronous pipelines where each stage has a single responsibility and predictable behavior.

The design intentionally favors clarity over cleverness, and correctness over premature optimization.

Key ideas behind the design:

  • Clear ownership and immutability across stages
  • Async concurrency only where it provides real value (sources, side effects)
  • Deterministic, sequential transforms for ranking logic
  • Strong trait boundaries for easy testing and experimentation

Status

🚧 Early scaffolding

Core traits, structure, and execution model are in place.
APIs may evolve as the pipeline matures and more real-world constraints are explored.


Architecture (High Level)

Domain

  • Query — request-level context
  • Candidate — entity being ranked

Pipeline Stages

  • Source — produces candidates (fan-out, async)
  • Hydrator — enriches candidates
  • Filter — removes candidates
  • Scorer — mutates candidate scores
  • Selector — chooses final results
  • SideEffect — observes results (read-only)

Execution Model

  • Sources run in parallel to reduce latency
  • Hydrators, filters, scorers run sequentially for deterministic behavior
  • Side effects run in parallel but are strictly read-only
  • No shared mutable state inside the pipeline core

Side effects are intentionally prevented from:

  • Reordering candidates
  • Dropping candidates
  • Mutating candidate data

Tech Stack

  • Rust (edition 2024)
  • Tokio
  • async-trait

No additional async utilities or futures crates are used.


Testing

Each pipeline stage is designed to be tested in isolation.

This enables:

  • Clear failure attribution
  • Faster feedback loops
  • Confidence in composition without relying solely on end-to-end tests

Async tests use #[tokio::test].


Running

cargo run

Notes

This project is primarily an architectural exploration.
It aims to model how real production ranking or matching systems are structured,
while keeping the codebase small, explicit, and readable.

About

Async, modular Rust pipeline for candidate ranking: sourcing → hydration → filtering → scoring → selection → side effects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages