Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [async]

Filter by
Sorted by
Tagged with
1 vote
2 answers
140 views

I’m migrating a large volume of historical RRD data into a VictoriaMetrics cluster. By design, vminsert buffers and asynchronously forwards data to vmstorage. This makes it unclear when data is ...
SPYN's user avatar
  • 21
2 votes
2 answers
242 views

I have a complex process implemented in Java Spring microservice. Currently this process is triggered on user request and it is synchronously executed. This often results in a gateway timeout. ...
DimitrijeCiric's user avatar
6 votes
2 answers
584 views

How is async logic implemented natively without threads? What would be the high level structure of the system? Is it just a separate OS thread that gets and pushes requests and results in 2 queues? I ...
codefast's user avatar
  • 179
0 votes
2 answers
1k views

Say I have an asynchronous method: public async Task DoThing(int x) { // ... } Now, I want to wrap this method with a new method. Each of these two options are functionally equivalent: public ...
AAM111's user avatar
  • 161
1 vote
0 answers
519 views

I have a Python FastAPI server application which naturally guides you towards the asynchronous paradigm. For legacy reasons, I have to support two backends, one which is purely synchronous and one ...
user3058865's user avatar
1 vote
0 answers
134 views

Had a discussion today in how to implement services that work with messages coming in from event queues. We call these services processors. One of us argues for using several functions, while the ...
Albert Balbastre-Morte's user avatar
2 votes
2 answers
459 views

I'm reviewing changes to a widely used library, which are supposed to be refactorings, and so we want to minimize the risk of introducing any accidental regression. Of course, there are changes from ...
Tim Lovell-Smith's user avatar
8 votes
1 answer
5k views

I have been going over our app web api and making sure all async work is async all the way - and no artificial asynchronicity is enforced. Say I have the following web api controller: [HttpGet] ...
Veverke's user avatar
  • 541
0 votes
1 answer
217 views

Imagine a simple set up of an API and a 2nd service, where the API pushes some msgs to the message queue and the service pulls them and processes them. Now, if an error occurs while processing a msg, ...
Milkncookiez's user avatar
0 votes
1 answer
618 views

I'm thinking of a designing a review system (restaurant, hotel etc) where users can drop star reviews. Typically in a such a application, you can see the average rating of an entity along with all ...
Ahmed Sadman Muhib's user avatar
0 votes
1 answer
224 views

I have a Nest.js application, and lately I've been thinking about how I can ensure that data is synchronized between two sources - my database and an external database. For example - and to my ...
Michael Jay's user avatar
0 votes
1 answer
335 views

More specifically this applies only to resources which have asynchronous dependencies themselves (but I think that's majority of them). Concrete example: class Foo : IAsyncDisposable { public ...
Shadow's user avatar
  • 361
49 votes
6 answers
32k views

I'm having a hard time wrapping my head around the use of async/await and regular sync function calls in JavaScript. Let's say I have two functions: Function 1: async function doSomething() { ...
noblerare's user avatar
  • 1,401
0 votes
3 answers
214 views

In C#, how do I handle critical section with two different "rights of way"? Theoretical use case: imagine a swimming pool (the resource). Many individual swimmers (worker threads A, B, C, ...
Yann's user avatar
  • 119
4 votes
1 answer
565 views

What I try to solve: Given I run a set of microservices, most of which expose a RESTful API and additionally publish or consume events via messaging broker, and I have decided to go "API first&...
observer's user avatar
  • 167
0 votes
1 answer
143 views

Hello we have an async event-driven system (kotlin, spring cloud stream, rabbitmq) where there might be an event FooPayloadArrived, published by an ingress rest-controller. Processing this ...
hotzen's user avatar
  • 115
4 votes
1 answer
423 views

This post implies that the creators of Rust had to add the "async" keyword to make the async/await functionality backward compatible. Why do we need the async keyword? In a new language, ...
phil-daniels's user avatar
0 votes
1 answer
1k views

We are looking to develop an asynchronous server in C++. We are coming from C#, which has built-in support for async-await networking. However, with C++ it appears as if it is basically mandatory to ...
lol's user avatar
  • 113
-3 votes
1 answer
239 views

In JS, code runs single-threaded, that's why asynchronicity is necessary. I cannot use code like result = someRequest(), instead I need to give it a callback someRequest(resultCallback) or write a ...
phil294's user avatar
  • 179
2 votes
2 answers
529 views

Here is the situation. System A sends the notification as it completes the work items to System B. System A does not know how many items the project consists of. It's just a pass-through system. ...
user1473349's user avatar
2 votes
1 answer
4k views

A while ago I read an article stating that overhead of an async/await call was around 50ms. More recently I read an article that it was around 5ms. I was having a discussion about whether we should ...
Ian's user avatar
  • 423
1 vote
3 answers
1k views

Imagine you have to process each row in a large table. For every single row you have to download some data from a web service and store it in a different database. Loading all rows at once into the ...
user avatar
-3 votes
1 answer
238 views

So this is in regards to scraping yes; no language in particular. Some sites allow you to see a JSON modal if you pull it directly from a web browser. But, at any notion a program is used, immediately ...
herboren's user avatar
0 votes
2 answers
477 views

It is my first question here so I hope I'm not doing a mistake. I see a plethora of questions in SO that people ask "how can I call an async method from a sync method?". Given my little ...
Soner from The Ottoman Empire's user avatar
1 vote
1 answer
329 views

I am working with a message broker technology, to which events will be published (following an "event carried state transfer" architecture) for consumption by other applications. The vendor ...
allmhuran's user avatar
  • 316
1 vote
1 answer
372 views

I have a C# (WPF) application which consumes a particular 3rd party API/tool (let's call this Tool A). My colleagues and I are trying to decouple that from our application, so that it is possible to ...
Jai's user avatar
  • 113
2 votes
2 answers
1k views

We have multiple producers that publish messages to the same SQS queue. We have a single consumer that processes the messages. The producers do not care about the response. It is more like a broadcast ...
kashive's user avatar
  • 137
-2 votes
1 answer
305 views

I work on a small component in an embedded device (sensor). This component : Every 5 seconds, sends requests to other components using sockets (get health check status, operating status etc) and ...
psy's user avatar
  • 137
2 votes
1 answer
3k views

I have used Utf8Json a lot (it is very good) but have since adapted some lower level code and started using Utf8JsonReader directly. Looking into the code of the Utf8Json library, I see ...
morleyc's user avatar
  • 345
-1 votes
2 answers
676 views

Suppose that I have a Value Object representing an Image URL of a Cake. To check that it really is a cake, I make an asynchronous API call to a server that checks whether the image really represents ...
Hillel SAAL's user avatar
3 votes
3 answers
2k views

Let's say I'm trying to write a library that abstracts certain actions. In this example I want to turn a light on or off. There could be hundreds of different kinds of lights that are controlled in ...
cost's user avatar
  • 171
0 votes
1 answer
135 views

I'm struggling a bit for a preferred way to organize a sequence of asynchronous tasks that can be applied in parallel. Say, you are parsing data from many files. In my case I'm using javascript and ...
user949300's user avatar
  • 9,029
4 votes
3 answers
1k views

In his book "Concurrency in C# Cookbook", Stephen Cleary writes: If you can, try to organize your code along modern design guidelines, like Ports and Adapters (Hexagonal Architecture), which ...
D.R.'s user avatar
  • 241
4 votes
1 answer
2k views

So, in C#, I understand the historical difference between the two vaguely; a Task is a newer concept and the highest level concurrency native C# offers. AsyncResult is a bit more ambiguous. For ...
gabriel.hayes's user avatar
0 votes
2 answers
161 views

Context: I'm building a popup widget. The html and css files are stored in S3. I need to get those files asynchronously and then continue with the rest of the logic. In the code below, I'm getting ...
EnterPassword's user avatar
5 votes
1 answer
2k views

I'm developing a client library. I'd like to provide both Sync and Async interfaces to endpoints on a server. They would be rather easy to implement as completely separate entities, but I would like ...
Felix's user avatar
  • 387
0 votes
1 answer
2k views

I built an async multi-client TCP server for RPC usage. It's working well but I've found it difficult to unit test certain functionality: Connect 2x clients, is client count 2 Connect 1x client,...
Naxin's user avatar
  • 111
7 votes
2 answers
4k views

I'm curious how the async/await syntax is converted to Promises. Maybe I'm just not thinking about it properly, but I don't know how this code would be converted to a Promise: async function myFunc(...
dx_over_dt's user avatar
1 vote
1 answer
366 views

I am working on creating a simple VM sort of thing in JS: let sp = 0 // stack pointer let m = [] // memory initialize: sp = 0 invoke: m[sp] = m[sp - 1] // position in stack m[sp + 1] = input[m[...
Lance Pollard's user avatar
0 votes
0 answers
86 views

Imagine a typical HTTP service that does async db queries. If HTTP requests are received more quickly than the db can complete queries (such as because the db disk or network is slow), the Promises ...
squarewav's user avatar
  • 206
1 vote
0 answers
54 views

Overview of application: A chat bot that connects via IRC, using TPL. As messages come from the socket (from .ReadAsync()), they are ultimately parsed and passed to a handler within the bot itself (...
Blue's user avatar
  • 89
18 votes
3 answers
39k views

Since the inception of .NET Core, console apps, function apps, ASP.NET etc. are not using synchronization context in async methods (so they're synchronizing straight to Thread Pool). This means that ...
kor_'s user avatar
  • 289
3 votes
1 answer
475 views

Consider a simple — and fake — interface: interface ISuperGetter { Super Get(); } An implementation would get some Super from RAM. One would store what it needs on disk. Yet another could fetch the ...
user avatar
2 votes
2 answers
157 views

I've seen this approach several times, both in async and multithreaded code. A counter is used to track asynchronous behavior or thread behavior - whenever a new action is started, the counter is ...
Dan Monego's user avatar
7 votes
3 answers
5k views

I'm expressing my frustration here somewhat, but why do many new libraries only have asynchronous APIs? For example I'm creating a small utility to fetch a web page and parse some data from it. ...
spirc's user avatar
  • 290
7 votes
2 answers
1k views

To keep scope small I will talk about UI race conditions initiated by the same user in the same app sessions. The question is general and not specific to mobile, web or desktop UI. The issue Modern ...
KolA's user avatar
  • 645
0 votes
1 answer
199 views

I'm writing an application that needs to log error/ exception messages but should still continue execution if the error is not a fatal error. I was thinking of making a method that returns a Task but ...
BipinR's user avatar
  • 163
13 votes
1 answer
9k views

I'm a long time Java developer, but with so little traffic on SE, I don't limit my viewing to any single tags. I've noticed that C# questions with async/await come up a lot, and as far as I've read it'...
Kayaman's user avatar
  • 1,980
1 vote
1 answer
3k views

C# web scaffolding has an async call for every member. Why? For example: Async for a login call makes no sense. User has to wait for validation. What else would the app do until the application ...
J Armbruster's user avatar
2 votes
1 answer
711 views

I think I know the answer to this, but it's particular enough that I don't want to go telling other people stuff until I'm 100% certain. Suppose I have a class with some dependency: public interface ...
Scott Hannen's user avatar
  • 1,064