tpl-dataflow

Avoid shutting down an entire data flow network when one block is faulted

怎甘沉沦 提交于 2021-01-27 22:20:44
问题 I am using DataFlowEx and am wondering how I can avoid shutting down an entire DataFlow if an exception is thrown. I have a system where tasks will come in at random times, and I want the network to log failures, abandon that particular task and continue with execution of the others. In reading the documentation on both TPL and DataFlowEx, specifically things like It [a faulted block] should decline any further incoming messages. Here DataflowEx takes a fast-fail approach on exception

TPL DataFlow - Batching on duration or threshold

最后都变了- 提交于 2021-01-22 05:22:51
问题 I have implemented a producer..consumer pattern using TPL data flow. The use case is that code reads messages from the Kafka bus. For efficiency, we need to process messages in batches when going to the database. Is there a way in TPL data flow to hold on to the message and fire whenever a size or duration threshold is hit? Example, the current implementation post the message once it is pulled from the queue. postedSuccessfully = targetBuffer.Post(msg.Value); 回答1: Buffering by count and

TPL DataFlow - Batching on duration or threshold

回眸只為那壹抹淺笑 提交于 2021-01-22 05:22:09
问题 I have implemented a producer..consumer pattern using TPL data flow. The use case is that code reads messages from the Kafka bus. For efficiency, we need to process messages in batches when going to the database. Is there a way in TPL data flow to hold on to the message and fire whenever a size or duration threshold is hit? Example, the current implementation post the message once it is pulled from the queue. postedSuccessfully = targetBuffer.Post(msg.Value); 回答1: Buffering by count and

For a TPL Dataflow: How do I get my hands on all the output produced by a TransformBlock while blocking until all inputs have been processed?

╄→гoц情女王★ 提交于 2021-01-16 04:00:52
问题 I'm submitting a series of select statements (queries - thousands of them) to a single database synchronously and getting back one DataTable per query (Note: This program is such that it has knowledge of the DB schema it is scanning only at run time, hence the use of DataTables ). The program runs on a client machine and connects to DBs on a remote machine. It takes a long time to run so many queries. So, assuming that executing them async or in parallel will speed things up, I'm exploring

For a TPL Dataflow: How do I get my hands on all the output produced by a TransformBlock while blocking until all inputs have been processed?

会有一股神秘感。 提交于 2021-01-16 03:56:40
问题 I'm submitting a series of select statements (queries - thousands of them) to a single database synchronously and getting back one DataTable per query (Note: This program is such that it has knowledge of the DB schema it is scanning only at run time, hence the use of DataTables ). The program runs on a client machine and connects to DBs on a remote machine. It takes a long time to run so many queries. So, assuming that executing them async or in parallel will speed things up, I'm exploring

For a TPL Dataflow: How do I get my hands on all the output produced by a TransformBlock while blocking until all inputs have been processed?

一曲冷凌霜 提交于 2021-01-16 03:55:00
问题 I'm submitting a series of select statements (queries - thousands of them) to a single database synchronously and getting back one DataTable per query (Note: This program is such that it has knowledge of the DB schema it is scanning only at run time, hence the use of DataTables ). The program runs on a client machine and connects to DBs on a remote machine. It takes a long time to run so many queries. So, assuming that executing them async or in parallel will speed things up, I'm exploring

For a TPL Dataflow: How do I get my hands on all the output produced by a TransformBlock while blocking until all inputs have been processed?

徘徊边缘 提交于 2021-01-16 03:54:56
问题 I'm submitting a series of select statements (queries - thousands of them) to a single database synchronously and getting back one DataTable per query (Note: This program is such that it has knowledge of the DB schema it is scanning only at run time, hence the use of DataTables ). The program runs on a client machine and connects to DBs on a remote machine. It takes a long time to run so many queries. So, assuming that executing them async or in parallel will speed things up, I'm exploring

Send parallel requests but only one per host with HttpClient and Polly to gracefully handle 429 responses

空扰寡人 提交于 2020-12-31 04:31:08
问题 Intro: I am building a single-node web crawler to simply validate URLs are 200 OK in a .NET Core console application. I have a collection of URLs at different hosts to which I am sending requests with HttpClient . I am fairly new to using Polly and TPL Dataflow. Requirements: I want to support sending multiple HTTP requests in parallel with a configurable MaxDegreeOfParallelism . I want to limit the number of parallel requests to any given host to 1 (or configurable). This is in order to

TPL DataFlow One by one processing

☆樱花仙子☆ 提交于 2020-12-13 03:51:20
问题 I am having system that continuously processing messages. I want to make sure that I request messages from an external queue only when previous message was processed. Lets imagine that GetMessages method requests messages from external queue. Got event 1. Will push it Pushed 1 Got event 2. Will push it - my concert is here. As we get item before processing previous Processing 1 Processed 1 Deleted 1 Code: using System; using System.Collections.Generic; using System.Linq; using System