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

Questions tagged [asynchronous-programming]

Filter by
Sorted by
Tagged with
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
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
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
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
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
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
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
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
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
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
22 votes
1 answer
14k views

Asynchronous non-blocking event driven programming seems to be all the rage. I have a basic conceptual understanding of what this all means. However what I'm not sure is when and where my code can ...
xenoterracide's user avatar
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
14 votes
1 answer
6k views

I'm learning NodeJS and just wanted to clarify something. In several introductory tutorials and books so far, very early on they've described Node's "non-blocking" architecture - or rather that it's ...
Anonymous's user avatar
  • 3,566
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
13 votes
1 answer
2k views

Lately I can't seem to get enough of the amazing async-await pattern of C# 5.0. Where have you been all my life? I'm absolutely thrilled with the simple syntax, but I'm having one small difficulty. ...
talkol's user avatar
  • 255
12 votes
2 answers
22k views

Okay, it sounds odd, but the code is very simple and explains the situation well. public virtual async Task RemoveFromRoleAsync(AzureTableUser user, string role) { AssertNotDisposed(); var ...
Ripped Off's user avatar
  • 3,757
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
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
9 votes
1 answer
1k views

I'm writing a COM add-in that's extending an IDE that desperately needs it. There are many features involved, but let's narrow it down to 2 for the sake of this post: There's a Code Explorer ...
Mathieu Guindon's user avatar
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
8 votes
1 answer
596 views

I'm trying to make (yet another) language that compiles to JavaScript. One of the features I'd like to have is the ability to perform JavaScript's async operations synchronously (not exactly ...
a pfp with melon'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
3 answers
1k views

I've seen this in C#, Hack, and now Kotlin: await or an equivalent operation can only be performed in special "async" contexts. Return values from these are, to borrow Hack's terminology, "awaitable" ...
concat's user avatar
  • 517
7 votes
1 answer
6k views

Call stack may contain several methods returning Task. If all of them are decorated with async, the flow of execution is quite simple. However, what if one of them is not awaited - are other method ...
nix's user avatar
  • 543
7 votes
1 answer
2k views

I started learning functional programming, I am trying to compare between different algorithms that are written in an imperative, functional , parallel programming and using Collections and Lambda ...
user3047512's user avatar
7 votes
1 answer
478 views

I'm designing API for a python library that accepts asynchronous input and produces the asynchronous output: various signals come in, and various signals are generated in response (there's no one-to-...
max's user avatar
  • 1,115
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
6 votes
1 answer
1k views

I have adopted a pattern in one of my projects that I really like and I suspect it's likely to be something standard. I'd like to describe it here and see if you guys can tell me how other ...
zumalifeguard's user avatar
6 votes
2 answers
1k views

I'm maintaining a system providing a typical synchronous web service REST API. It routes each request to one of several possible backend services. Now there is a new backend I want to use, but there ...
Torbjørn's user avatar
  • 750
6 votes
1 answer
2k views

Summary I am developing a WAV file format reader under WinRT, and for this I need to read random amounts of structs consisting of fundamental types such as int, uint, float and so on. Back in ...
aybe's user avatar
  • 955
6 votes
1 answer
3k views

I want to model an asynchronous request-response message exchange in UML. The request is sent from a client to a server. The server responses asynchronously. This can be modelled in a component ...
Claude's user avatar
  • 183
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
6 votes
1 answer
1k views

Is there a best practice for using Guava's ListenableFuture in parameters in API calls? Compare these two versions of an interface that internally does a compare-and-set (I'm using Guava's ...
David Ehrmann's user avatar
5 votes
4 answers
4k views

I'm writing a function in the node.js-style asynchronous way, but how do I know if these functions are truly asynchronous, i.e., that they run in parallel and not sequentially? Here is my code (...
chharvey's user avatar
  • 264
5 votes
1 answer
8k views

I took it upon myself recently to work towards making a general-purpose Translator to automatically translate js programs into C, but I got stuck when thinking of asynchronous behaviour. Using ANSI / ...
Francesco Gramano's user avatar
5 votes
6 answers
8k views

Asynchronous programming seems to be getting quite popular these days. One of the most quoted advantages is performance gain from removing operations that block threads. But I also saw people saying ...
Euphoric's user avatar
  • 38.2k
5 votes
3 answers
5k views

I am developing an application that consumes data from an external service. The application is being implemented following a typical layered architecture with UI, Presentation, Domain and Data layers....
SonOfPirate's user avatar
  • 2,935
5 votes
3 answers
2k views

I am working on a C library (SlipRock) for interprocess communication. The library currently exposes a simple, blocking API. This is easy to use, makes misuse (relatively) difficult (this is C after ...
Demi's user avatar
  • 826
5 votes
1 answer
3k views

If I have function which returns a future, is there any reason to also include a callback where the callback is simply called right before the future completes? The only advantage I can think of ...
Zhro's user avatar
  • 191
5 votes
1 answer
3k views

I'm playing around with async and await, and they seem pretty intuitive, but some of the things I'm reading about these keywords doesn't make sense to me. In fact, some of it seems to me to be flat-...
user1172763'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
5 votes
2 answers
346 views

I'm trying to design an asynchronous component. Requirements on this component are : Component might receive events at any point in time Component might start a long-running operation and wait for its ...
Euphoric's user avatar
  • 38.2k
5 votes
1 answer
431 views

Turned out, this question is not easy to formulate for me, but let's try. In Android, pretty much any UI object depends on a Context, and has defined lifetime. Android can also destroy and recreate UI ...
Display Name's user avatar
4 votes
6 answers
6k views

I am wondering if there exists a way to half way synchronize javascript functions, where data is requested on the fly. I don't want to make it purely blocking (which I guess is impossible), I just ...
Ramzi Kahil's user avatar
  • 1,089
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
4 votes
2 answers
3k views

I've got trouble wrapping my head around a certain problem: In my data-flow app (a visual editor), I have both autonomous objects which communicate though ports via unordered simultaneous messages ...
Jack Shade'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
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
4 votes
1 answer
210 views

The application I'm developing requires that some data is obtained through different channels. As this is a network process, I have decided to use async programming. I have designed the following ...
Daniel García Rubio's user avatar
4 votes
1 answer
25k views

I am developing an application that will read excel files from disk and then process tests based on the data in the files. In order to keep the user interface from locking up when loading files and ...
Tim Hutchison's user avatar