Skip to main content
Filter by
Sorted by
Tagged with
Best practices
3 votes
3 replies
87 views

I have the following application architecture: FrontEnd → ApiServer 1 → ApiServer 2 → Database So, the frontend calls a web server, which calls multiple API which make query on database. What is the ...
Massimo Lavermicocca's user avatar
0 votes
2 answers
60 views

I'm trying execute an HTTP request to receive some data (for example as a stream), but with ability to cancel this request at any time. I've read about CancellationToken and use it for cancel request (...
ibogolyubskiy's user avatar
-1 votes
1 answer
116 views

I'm noticing some strange behaviour with CancellationTokenSource wherein when I call the Cancel() method, IsCancellationRequested takes some time to update. I am not sure if this is the cause, but in ...
komodosp's user avatar
  • 3,686
2 votes
0 answers
117 views

In my Livewire project, I want to stop all previous requests when navigating to a new page. The issue arises when older requests are still loading, and if they result in a 500 error, it affects the ...
lkm's user avatar
  • 21
0 votes
1 answer
252 views

I have an ASP.NET Core console application, that runs a REST interface and a pool of websockets. When I press Ctrl-C in the console, it shuts down correctly, unless I have a WebSocket connected. That ...
Bart Friederichs's user avatar
0 votes
1 answer
97 views

I have to stop the API execution through the Cancellation Token, In my method no for loops to check every time the cancellation requests, how to achieve it. I am using .NET core API I have tried the ...
Eliyas Basha's user avatar
1 vote
0 answers
76 views

I have a .Net service that functions as a bridge between RabbitMQ and another service. Messages are received and forwarded; Replies are received and delivered to RabbitMQ. Internally I have some ...
JesperGJensen's user avatar
1 vote
1 answer
162 views

Im testing CancellationToken behaviour in my UserRepository. When I use cancellationToken from parameters and cancel query with postman this works without exception (and it really cancels query). It ...
Daniil Kozenko's user avatar
1 vote
0 answers
213 views

I'm facing an issue with Crystal Reports where, once the report generation starts, it blocks other tasks and does not stop even after a certain time. I want to implement a timeout feature, where the ...
Av.Raj's user avatar
  • 65
0 votes
1 answer
106 views

I have code like below. Simply run the while loop for a long time. public void Test(){ var task1 = Task.Run(() => { while(true){ // forever } } } When Test()...
yolo's user avatar
  • 767
0 votes
1 answer
116 views

I thought this would just be a quick and easy problem to solve, but alas it is not. I'm trying to find a way of sending a "CancellationToken" from my python client implementation which ...
PureAlpha's user avatar
0 votes
1 answer
353 views

I have the code below where I call a service to fetch data, then save the data in a list (transfers). Then I loop through each transfer to update a specific row in the DB. QUESTIONS - Do I need to ...
chuckd's user avatar
  • 14.8k
0 votes
1 answer
439 views

I just came into a very strange issue regarding cancellationToken. The web API is developed using .Net Core and frontend is in Angular. 1 hour ago I try to develop more feature and before starting I ...
AoLiGei's user avatar
  • 81
0 votes
1 answer
113 views

public void Read(string file) { _read ?? = new Thread(() => MethodA(file)); _read.Start(); } private void CancelReading() { if (_read != null) { if (!_read.Join(100)) ...
fahmid07's user avatar
1 vote
0 answers
167 views

I have a system that links tokens received from different places. Then, it uses this merged token to perform some task. The final merged token can consist of 5 different tokens. While the task is ...
Demexis's user avatar
  • 45
1 vote
0 answers
148 views

I have a simple BackgroundService. protected override async Task ExecuteAsync(CancellationToken stoppingToken) { while (!stoppingToken.IsCancellationRequested) { NotifyBase? ...
David Thielen's user avatar
-2 votes
1 answer
185 views

So, I'm learning Cancellation tokens and I'm trying this example. The writeline is never working even if I cancel this method from the outside. So how this works, is the initializeAsync, if it takes ...
De Flight's user avatar
1 vote
1 answer
132 views

I am trying to implement semaphore slim for a set of tasks that are meant to request some data to an external API. The data might have different formats, so the plan is to return HttpResponseMessage, ...
Iria's user avatar
  • 89
1 vote
0 answers
109 views

I have an asynchronous method (IPCameraMethod) that handles IP camera streams. It starts and cancels tasks which manage these streams via WebSockets. The tasks are started in a separate class, ...
Captain C's user avatar
  • 191
4 votes
1 answer
841 views

I wrote the following C# code in .NET 6 in a simple console application. It captures "Interrupt" signal (i.e. Ctrl+C) and signals cancellation token source to cancel its token. Then in Main ...
Shishir Gupta's user avatar
0 votes
0 answers
144 views

I have a Task returned from a third party. It does not give me the option to insert a cancellation token when constructing the task. Can I insert a cancellation token into a task after the fact? ...
Evorlor's user avatar
  • 7,436
2 votes
3 answers
971 views

I have some business logic that does some long calculations, returns a result and doesn't accept any CancellationTokenSources and, accordingly, doesn't check for it's isCancellationRequested property. ...
David Oganesyan's user avatar
-2 votes
1 answer
282 views

I'm calling Class Library method within WPF app, using CancellationToken. Method exports data to Excel from Oracle, and sometimes operation takes too long or doesn't complete, so I tried with ...
Lucy82's user avatar
  • 693
1 vote
1 answer
619 views

I'd like to know if I need to use EnumeratorCancellation when passing a cancellation token to my local function. I am thinking of using this code pattern often in the future: public static ...
Zapdor's user avatar
  • 67
0 votes
0 answers
153 views

I'm looking for a way to be able to queue up a number of tasks to be completed in order, one after the other. But also for the functionality that when a new task is added, anything in the current ...
wforl's user avatar
  • 889

1
2 3 4 5
9