Skip to main content

Questions tagged [asynchronous-programming]

Filter by
Sorted by
Tagged with
-1 votes
2 answers
158 views

The title may have been a little vague... I am working on a piece of software that is designed to perform one task. I would like this task to work in parallel, allowing for multiple asynchronous ...
user0000001's user avatar
1 vote
1 answer
745 views

I got this problem in an interview and want to confirm multi threading adds no value here. Case: You are writing an agent to buy stocks. The agent is initialized with a set of stocks to buy when ...
AfterWorkGuinness's user avatar
1 vote
1 answer
713 views

Given the following code in the DoWork() event of a BackgroundWorker object, how can the concept be converted to the Async/Await model? I wish to execute multiple downloads simultaneously in order to ...
InteXX's user avatar
  • 283
0 votes
1 answer
171 views

Suppose I have two blocks of code, A and B. A is to be executed before B. As I understand, I can do one of two things: 1) Put B in a separate thread that is to be executed after A's thread, or 2) Put ...
moonman239's user avatar
  • 2,063
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
2 votes
2 answers
4k views

I have an application that reads a large binary file (1GB on average) and compresses into a bzip2 archive. I started out at first compressing these files synchronously, as I didn't want to impede ...
user0000001'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
4 votes
1 answer
1k views

I've been programming for a long time, but very rarely with anything asynchronous (and not often with anything to do with multithreading, either). Mostly for the fun of it, I'm writing a program to ...
exscape's user avatar
  • 141
0 votes
1 answer
627 views

I'm investigating how we can notify UI/async clients (websocket) about an update which happened in an embedded view. Let me elaborate... We currently have a newsfeed where NewsItem is an aggregate ...
Pepster's user avatar
  • 299
0 votes
0 answers
68 views

I'm writing a small application in TypeScript that has to do some asynchronous operation and I'm doing it with Promise and async/await sugar. But my problem do not rely on the particular language or ...
nkint's user avatar
  • 289
0 votes
2 answers
886 views

I have a project which involves using C++ files along with an API on a local PC to communicate with a remote server app, and for sake of maintaining a semblance of non-disclosure with any hired ...
CB001's user avatar
  • 19
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
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
0 votes
4 answers
2k views

To sync on the terms I will first give my perspective on what a callback function in the simplest possible terms: A callback function is a function that is executed as a response to a certain event ...
TheMeaningfulEngineer's user avatar
1 vote
3 answers
1k views

Background Most of the applications that I write are hour long sequential tests for electronic equipment. The equipment under test has a specification that is a state-machine that looks like... Get ...
Snoop's user avatar
  • 2,758
3 votes
1 answer
578 views

I was working on a bit of code for a personal project, when I came upon the need to generate checksums on large amounts of files. First off let me say I already solved this problem ideally using ...
Brandon's user avatar
  • 133
2 votes
3 answers
213 views

I have built a setup which solves my problem, but I've pretty much just hacked it together by reading AWS docs and trying things out, so I want to see if there is a better way. For the purpose of ...
Paul Siegel's user avatar
1 vote
1 answer
2k views

Using async I/O operations from boost::asio I often need shared pointers (and enable_shared_from_this and shared_from_this in callbacks) to avoid deleting objects too early. I think that it could be ...
pawell55555's user avatar
3 votes
3 answers
14k views

I am writing some new code and would like to write it using async and await, but the calling code does not currently support async. Is it right to write the new code in async and call it sync until ...
Jake Rote's user avatar
  • 131
-1 votes
1 answer
93 views

Say that you have an web application which prints pages in a document. Suppose that after validating the page range, the application does the following: If a billing option is turned on, it first ...
AmadeusDrZaius's user avatar
3 votes
1 answer
591 views

I'm doing some research for a project in which I will need to create a service which can handle millions of requests per minute. Clearly I want to use an asynchronous programming model to make the ...
Coding Gorilla'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
1 vote
1 answer
1k views

I have a scenario where I have a Windows Store Application, there is a page with a search functionality, the user types names in a textbox and the app searches for names similar to the typed text. ...
Mina Wissa's user avatar
1 vote
1 answer
2k views

I'm learning Python, more specially parallel programming using Python Parallel Programming Cookbook by Giancarlo Zaccone. At the time the book was published async/await was still in the beta version ...
user avatar
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
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
1 vote
1 answer
2k views

I'm really glad that EcmaScript 6 has promises built into the language, but the syntax will still be quite wordy: new Promise(f).then(r => { ... }).then(r2 => ... }).catch(... I'm just ...
Steve Bennett's user avatar
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
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
2 votes
1 answer
1k views

I'm developing an app at work, this is my first big application and in my smaller projects I didn't use caching at all. What's currently happening When the user logs on for their very first time ...
Dan Beaulieu's user avatar
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
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
2 votes
2 answers
3k views

I'm trying to switch my brain from Node.js/Objective-C iOS programming to C++ programming, and it's a little bit taxing. Node.js and Objective-C with iOS do not have a run loop that I am supposed to ...
Mikey A. Leonetti's user avatar
3 votes
1 answer
371 views

Is there a connection between futures and exceptions? async-await looks very similar to throw-catch.
Nils von Barth's user avatar
4 votes
2 answers
778 views

I'm creating a library that contains a class that exposes several Async methods: public class MyClass { public async Task<Foo> DoFooAsync() { /*...*/ } public async Task<Bar> ...
RobIII's user avatar
  • 341
2 votes
1 answer
1k views

I've been using Nodejs and I really dislike callbacks (as i think most people do.) I'm starting to learn about promises and generators. Both are a lot cleaner and I'd like to forget the horrors of ...
Cyph's user avatar
  • 121
1 vote
1 answer
796 views

Variable context from an initial non-reactive caller The whole application cannot be reactive i.e. this method needs to return a result here public string GetTextOfInterest() { var ...
Cel's user avatar
  • 145
4 votes
3 answers
7k views

I am sure that this is a common design pattern, but I seem to have a blind-spot. I have a requirement that the function call from Application to Service be blocking, but service needs to do something ...
Mawg's user avatar
  • 4,308
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
1 vote
1 answer
196 views

As a follow-up to my other question, if one were to build a general-purpose translator from a language that has support (be it with an external library or otherwise) for asynchronous behaviour to a ...
Francesco Gramano's user avatar
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
1 vote
1 answer
2k views

The application to be designed serves as a bridge between two different systems. One natively speaks TCP (RS232 actually, but there's a COM->ETH server in the line of communication) - the other one is ...
lapsus's user avatar
  • 111
-4 votes
1 answer
1k views

I'm building a penny-auction platform like DealDash and just read into the WebSocket and node.js topic. I used PHP, MySQL and Ajax to build the website. I'm nearly finished and just have to implement ...
AlexioVay's user avatar
  • 137
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
0 votes
1 answer
404 views

A system design is decoupled into two layers say layer A and layer B. The interaction between layer A and layer B occurs through an interface that is exposed by layer B in form of an API. This ...
user1302884's user avatar
1 vote
1 answer
7k views

Consider you have a simple, standard $http request to a REST api: ... function makeCall() { var restURL = "http://my-rest-api/endpoint"; return $http.get(restURL); } ... If the execution time ...
A n d r e w Ferguson's user avatar
2 votes
1 answer
958 views

I am fairly experienced with async and concurrent programming in c# using event, actor, and task based patterns, but now I have a task in c++ with which I have basic familiarity and it needs some ...
kcar's user avatar
  • 133
2 votes
1 answer
178 views

Say I'm working with a system that allows async, nonblocking operations. If I queue up a set of those operations and specify their result buffer references: nonblocking_write( message, write_buffer )...
kdbanman's user avatar
  • 1,457
0 votes
2 answers
272 views

Regardless of library, language, or spec, asynchronous send/write operations make sense to me, because code later in the execution path may not have any dependency upon the success or failure of the ...
kdbanman's user avatar
  • 1,457
2 votes
2 answers
2k views

I have an object Foo that has 2 public properties: A and B. These properties can be changed from outside, as the application I'm working on is using a data-binding architecture. This is the front-...
Cristian's user avatar
  • 125