File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
crates/derivation-pipeline/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ impl Stream for DerivationPipeline {
9494 }
9595}
9696
97+ /// The maximum number of concurrent batch derivation futures.
98+ const DERIVATION_PIPELINE_WORKER_CONCURRENCY : usize = 5 ;
99+
97100/// A structure holding the current unresolved futures for the derivation pipeline.
98101#[ derive( Debug ) ]
99102pub struct DerivationPipelineWorker < P > {
@@ -170,8 +173,7 @@ where
170173 tokio:: select! {
171174 biased;
172175
173- // TODO: consider adding a filter on the receiver channel to limit the number of active derivation futures / concurrency.
174- Some ( batch_info) = self . batch_receiver. recv( ) => {
176+ Some ( batch_info) = self . batch_receiver. recv( ) , if self . futures. len( ) < DERIVATION_PIPELINE_WORKER_CONCURRENCY => {
175177 let fut = self . derivation_future( batch_info) ;
176178 self . futures. push_back( fut) ;
177179 }
You can’t perform that action at this time.
0 commit comments