Skip to content

Controlling parallelism of pipelines #151

Answered by daveaglick
jerriep asked this question in Q&A
Discussion options

You must be logged in to vote

I can think of a couple things you could try, but you’re correct that the optimal solution would be to pre-fetch data where you can really tailor the throttling. A lot of the modules have been designed to rip through work as fast as the internal Task thread pool will allow (independent of inter-pipeline parallelism as you noticed).

For reference, the RenderRazor module uses this ParallelSelectAsync extension which boils down to a bunch of Task.Run() wrapped in a Task.WhenAll().

So here’s some options:

  • Add some throttling directly to the shortcode. The easiest way might be to use a locking primitive like a SemaphoreSlim. You should be okay on deadlock problems since Razor rendering doesn’…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jerriep
Comment options

@jerriep
Comment options

@daveaglick
Comment options

Answer selected by jerriep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants