Skip to main content
added 302 characters in body
Source Link

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.SendmessageToRestServiceAsync(); - calls a rest service await _service2.SendMessageToKafkaAsync(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background.The order of execution is not important.

The documentation in the link says " Creates a task that will complete when all of the supplied tasks have completed." the SendMessageAsync is already called inside a whenall. My question is there a way, the call to SendmessageToRestServiceAsync can be independent of other task @PeterDuniho –

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.SendmessageToRestServiceAsync(); - calls a rest service await _service2.SendMessageToKafkaAsync(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background.The order of execution is not important

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.SendmessageToRestServiceAsync(); - calls a rest service await _service2.SendMessageToKafkaAsync(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background.The order of execution is not important.

The documentation in the link says " Creates a task that will complete when all of the supplied tasks have completed." the SendMessageAsync is already called inside a whenall. My question is there a way, the call to SendmessageToRestServiceAsync can be independent of other task @PeterDuniho –

added 69 characters in body
Source Link

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.SendmessageSendmessageToRestServiceAsync(); - calls a rest service await _service2.SendMessageSendMessageToKafkaAsync(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background.The order of execution is not important

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.Sendmessage(); - calls a rest service await _service2.SendMessage(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.SendmessageToRestServiceAsync(); - calls a rest service await _service2.SendMessageToKafkaAsync(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background.The order of execution is not important

6
Peter Duniho
  • 71k
  • 7
  • 113
  • 149
Post Closed as "Duplicate" by Peter Duniho c#
added 45 characters in body
Source Link

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.Sendmessage(); - calls a rest service await _service2.SendMessage(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.Sendmessage(); await _service2.SendMessage(); } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background

I have a scenario where in My .Net Standard project,I have a api

public async Task SendMessageAsync(){ await _service1.Sendmessage(); - calls a rest service await _service2.SendMessage(); - calls a kakfaclient } 

The SDK users are using this service concurrently like 100,1000 times and reporting performance issues.

var tasks = Enumerable.Range(1, 100).Select(i =>SendMessageAsync()); await Task.WhenAll(tasks); 

I want to run await _service1.SendMessage(); in a way so that if even there is an exception it shouldn't stop await _service2.SendMessage();

As this call is mandatory always and shouldn't be affetced. All the concurrent Requests made for await _service1.Sendmessage(); should be run on a background thread or a different thread so that the performance is not affected.

I did check the ThreadPool.QueueWorkItem which accepts a delegate but it is return type is void.

Is there a way to run all the calls to await _service1.Sendmessage(); in a background

added 1 character in body
Source Link
Loading
added 17 characters in body
Source Link
Loading
added 65 characters in body
Source Link
Loading
Source Link
Loading