Skip to main content

Questions tagged [asynchronous-programming]

Filter by
Sorted by
Tagged with
23 votes
4 answers
9k views

I don't understand why I keep seeing async/await recommended (or sometimes, even enforced) for ASP.NET Core web applications and APIs. As far as I can tell, every request is already being run on a ...
Medinoc's user avatar
  • 375
8 votes
5 answers
4k views

Suppose I have a constructor that performs an expensive IO operation that takes a noticeable amount of time. I don't like it for a few reasons (first of all, it's simply wrong, but there are practical ...
Sergey Zolotarev's user avatar
2 votes
2 answers
248 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
4 votes
3 answers
2k views

I inherited a piece of software. This program is connected to an external hardware, which is a measurement device. Every 100 milliseconds, a value is read from this device and displayed to the user. ...
SomeBody's user avatar
  • 151
6 votes
2 answers
588 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
1 vote
1 answer
402 views

Reading the Proactor pattern paper, specifically this part: I/O Completion Ports in Windows NT: The Windows NT operating system implements the Proactor pattern. Various Asynchronous Operations such ...
codefast's user avatar
  • 179
1 vote
5 answers
339 views

A couple days ago I asked about the Purpose of async/await in web servers, and got in-depth answers explaining how in fully asynchronous code, it frees up the CPU completely while also releasing the ...
Medinoc's user avatar
  • 375
34 votes
14 answers
14k views

I have not found many resources about this: I was wondering if it's possible/a good idea to be able to write asynchronous code in a synchronous way. For example, here is some JavaScript code which ...
Cinn's user avatar
  • 483
1 vote
2 answers
926 views

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node. I understand the asynchronous features are useful in many situations, but when I debug my code,...
SupaCowaFraja's user avatar
51 votes
4 answers
14k views

Python added the async/await constructs in 3.5 in 2015. The Javascript community made steps towards it for a bazzillion years and finally added a very similar implementation to the draft in ES8 ...
Ziv's user avatar
  • 3,106
10 votes
8 answers
4k views

My question will be mostly about Linux and contemporary X86 hardware. Clarifying the terms async event based programming: spawning fixed amount of threads and using some user space scheduling ...
Incomputable's user avatar
0 votes
1 answer
143 views

As I understand it, the join() method merge/composes/combines the results from all subtasks. A simple example I saw was summing the numbers from 1 to N and the subtasks would simply sum a range of ...
releseabe's user avatar
  • 539
58 votes
8 answers
9k views

Are events only used for GUI programming? How do you handle in normal backend programming when something happens to this other thing?
user3093620's user avatar
1 vote
0 answers
522 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
3 votes
3 answers
758 views

My problem is the following: inside a method I'm creating an object like this: MyObject* myObject = [MyObject new]; Then I want it to perform an asynchronous task like this: [myObject ...
Andrey Chernukha's user avatar
1 vote
1 answer
135 views

I have a process in golang that I want to kickoff through a RPC call but then have the function return early whilst the process continues in the background. Specifically it’s just a basic db transfer ...
Person1's user avatar
  • 21
99 votes
1 answer
64k views

When doing single-threaded asynchronous programming, there are two main techniques that I'm familiar with. The most common one is using callbacks. That means passing to the function that acts ...
Aviv Cohn's user avatar
  • 21.6k
48 votes
5 answers
37k views

Stumbled upon this post that talks about making async web requests. Now simplicity aside, if in real world, all you do is make an async request and wait for it in the very next line, isn't that the ...
Mrchief's user avatar
  • 631
2 votes
3 answers
2k views

I have read in a DDD book that using message queues between communicating services can make the whole architecture more scalable, amazon's documentation mentions that queues provide granular ...
takasugi's user avatar
  • 303
3 votes
3 answers
6k views

I have been searching extensively about the difference between synchronous and asynchronous patterns and how this relates to event driven architecture. On its face it is quite obvious, I simply ...
Frankster's user avatar
  • 189
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
27 votes
3 answers
25k views

I've been doing a lot of reading online trying to figure out how to write asynchronous JavaScript code. One of the techniques that has come up a lot in my research is to use callbacks. While I ...
Z. Charles Dziura'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
2 votes
3 answers
603 views

I have a function that performs a task which can either be performed immediately and without any blocking or it can only be performed after some delay. The caller of that function shouldn't need to ...
Mecki's user avatar
  • 2,390
13 votes
1 answer
10k 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
0 answers
293 views

Backstory Probably a stupid question, but I just have a sneaking suspicion that "asynchronous" is the wrong terminology to us for naming my template function here: template <class T> ...
Anon's user avatar
  • 3,649
10 votes
1 answer
4k views

I was reading about Reactive programming, and came across this article The introduction to Reactive Programming you've been missing with the quote I put in the question title: Reactive programming ...
m0meni's user avatar
  • 803
24 votes
3 answers
47k views

I have few async REST services which are not dependent on each other. That is while "awaiting" a response from Service1, I can call Service2, Service3 and so on. For example, refer below code: var ...
Ankit Vijay's user avatar
  • 1,638
-1 votes
3 answers
944 views

Say we call 10000 setTimeouts, each with a random time, each with a few nested timeouts too. What happens in terms of the 1 call stack, or are there multiple call stacks? How does that work? So for ...
Lance Pollard's user avatar
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
124 views

Context To level set, I've been working with OOP and FP for my whole career, so my experience with the imperative paradigm is limited. The team I joined is made up of very senior (20+ years xp) ...
Pete's user avatar
  • 1,247
3 votes
1 answer
11k views

I have a website which offers pages in the format of https://www.example.com/X where X is a sequential, unique number increasing by one every time a page is created by the users and never reused even ...
nicktheone's user avatar
0 votes
2 answers
479 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
0 votes
0 answers
56 views

UserA and UserB are signing up for some joint service together. They both have to independently agree to T&Cs before sign-up is complete. Once complete they both receive an email to sign-in. A 1 ...
mockitodorito's user avatar
-2 votes
2 answers
474 views

Given the same application written with multi-threading and async IO, will async IO use less power on a computer?
spencerbug's user avatar
-2 votes
1 answer
166 views

A social network has API, but also it has some limitations like the amount of requests that can be done in one second (let's say API will give an error, if it accepts more than 3 requests per second) ...
Roy King's user avatar
-4 votes
1 answer
449 views

A while ago Herb Sutter wrote The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software which I basically interpret to mean that, in order to improve performance, software engineers ...
Startec's user avatar
  • 157
6 votes
2 answers
4k views

I'm currently working on class with some async tasks under the hood. In fact I need to delegate few tasks to asynchronous execution and be sure that all of them are finished before class was destroyed,...
Liastre's user avatar
  • 181
22 votes
3 answers
9k views

I have a bunch of microservices whose functionality I expose through a REST API according to the API Gateway pattern. As these microservices are Spring Boot applications, I am using Spring AMQP to ...
Tony E. Stark's user avatar
29 votes
4 answers
18k views

I have been doing web-based Javascript (vanilla JS, jQuery, Backbone, etc.) for a few years now, and recently I've been doing some work with Node.js. It took me a while to get the hang of "non-...
Sean's user avatar
  • 393
2 votes
1 answer
799 views

I am wondering about this. This is a sort of follow-up to my last question here: In the MVC pattern, what has the responsibility for creating the view? because now I've run into the question of how to ...
The_Sympathizer's user avatar
-4 votes
3 answers
288 views

I have been reading about the concept but still it doesn't make sense to me. I want to clarify my question by giving an example. First of all, if we have task1 and task2 which have to run in sequence, ...
pnatk's user avatar
  • 133
0 votes
3 answers
239 views

Let's say we are building a threaded program in C, for example a message queue system where a thread is spawned to manage one end of the queue, and (re)connect sockets. This can roughly be set up in ...
Elmore's user avatar
  • 115
-3 votes
1 answer
243 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
0 votes
1 answer
391 views

Hi I am new to async/await in C# . I have created a controller which is accessing result from HttpClient injected through HttpFactory. Here is my working example class MyController { private ...
Rohit's user avatar
  • 109
3 votes
1 answer
390 views

Intro Hey, my question is kind of hard to explain so I apologize in advance. Question I'm trying to implement microservices for our ecommerce and I'm having issues on how to respond to a request when ...
typicallearner's user avatar
24 votes
1 answer
10k views

I spent the last week deep diving into the Akka docs and finally understand what actor systems are, and the problems that they solve. My understanding (and experience with) traditional JMS/AMQP ...
smeeb's user avatar
  • 4,970
0 votes
1 answer
348 views

I started using Pythons async features and want to fully understand their use cases. I see webserver like FastApi or Quart which use async features. How are they working different from webservers like ...
hadamard's user avatar
  • 140
4 votes
2 answers
5k views

I have a couple of functions, each function verifies a set of rules and updates a common object. The common object is just a container that holds a list of rules that passed or failed. I would like to ...
BipinR's user avatar
  • 163
1 vote
1 answer
576 views

I recently had a discussion with colleagues about the use of futures (std::future in C++) or asynchronous calls in server applications. On one hand, if you have server logic that needs to access an ...
Patrick's user avatar
  • 571