The asynchronous-programming tag has no usage guidance.
0
votes
0answers
38 views
Capturing keyboard events for a limited time
I'm trying to code a kind of simple video game where there are two kind of players:
Human Players: They enter an keyboard input
CPU Players: A random input is calculated
For Human Players there is a ...
4
votes
1answer
44 views
Building objects from multiple async server queries
I'm building a system that uses objects that are built using multiple Async queries to a remote server (Firebase) and queries to a local DB.
How should I design a module to generate these objects?
...
3
votes
1answer
88 views
How to document logical proofs against race conditions?
Specific Background
I'm writing a library to extend the async backbone of a language with cooperative multitasking. (The language is Hack, but C# also implements async-await with Task, if the concept ...
3
votes
1answer
61 views
Task Parallel Library Console Application Design - How do I lock a thread to a specific context?
I'm currently developing an application which relies on multiple sockets listening for chat messages. When the messages come in, they're passed off to a bot that's associated with their channels. ...
2
votes
1answer
52 views
Asyncronous processes competing for the output area
You enter the URL in the address string of your browser. It takes long time to appear in the client area. You are bored and type another address instead and click enter. Which page will be rendered in ...
0
votes
0answers
38 views
set-up of web-scraping and analysis in python with celery and rabbitmq
EDIT: Is this question too vague, too time-consuming to answer, too easy, placed in the wrong forum? It's my first question here, so I'd like to ask for some feedback so I can improve my question. ...
0
votes
0answers
31 views
How should I structure “hooks” that kick off multiple scripts, which could recursively call the same hooks?
I wrote a Trac plugin that can run external hook scripts whenever a ticket is changed, using the ITicketChangeListener extension point. Essentially, all it does is listen for when a ticket is created ...
1
vote
1answer
171 views
Calling multiple async services in parallel
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 ...
0
votes
1answer
94 views
Animations and React — is it bad practice to mix them?
I have been in arguments with programmers that mixing elements with animations and react is very bad practice, and that all animations should be in a style sheet because that is something ...
2
votes
3answers
88 views
Synchronising results from asynchronous tasks
In Android, I rather frequently need to get results from more than one service that utilizes an asynchronous callback pattern and I want to know if there's a better way to handle this pattern than ...
5
votes
0answers
75 views
API design: stream objects vs. functions vs. messages
I'm designing API for a python library that accepts asynchronous input and produces asynchronous output: various signals come in, and various signals are generated in response (there's no one-to-one ...
3
votes
2answers
182 views
What to call a method that calls itself asynchronously?
In UI-related code, I often end up writing a construct like this:
function doItOnceAndRepeat() {
if (!stillNeededToDoIt()) {
return;
}
doIt();
runLater(doItOnceAndRepeat, 1000)...
1
vote
1answer
167 views
Does omitting await keyword once in the call stack break the asynchronous behavior of the whole stack?
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 ...
0
votes
2answers
184 views
Why are Promises not “awaited” by default?
In the latest version of languages like TypeScript or ECMAScript you can use async/await constructs to write code that combines the clean structure of synchronous programming with the performance ...
1
vote
0answers
27 views
How to display a very delayed success message after async method call in WinForms after Form is closed
The users are on a Windows Form where they fill out a fax cover sheet and hit Send. The remote fax service takes anywhere from two seconds to two minutes to return a result (long timeout). By that ...
0
votes
1answer
73 views
Android Activitiy and Service Sync
I've looked for the solution of my problem but I've failed in finding a suitable answer.
I've been trying to develop an Android application with heavy asyncronous networking capabilities. The problem ...
3
votes
1answer
232 views
What is the functional programming method for combining two “streams” of data?
I'm trying to figure out what the appropriate way to deal with this problem is in a functional way. I'm assuming there's a functional data structure or technique that will make this easy to handle.
...
-1
votes
2answers
120 views
Designing an application with safe paralleled tasking
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 ...
0
votes
0answers
40 views
How should I implement a real-time endpoint server to handle new posts and events for a forum?
I am writing a forum component for a site and decided on using either nio or twisted for a real-time endpoint to accept users posts and notify other users who are in the same forum or page of new ...
0
votes
0answers
54 views
Asynchronous SOAP web service using Axis2 ADB
I am trying to implement a asynchronous method to send SOAP messages to a client. I have a web service for which I use SOAP to communicate with the client. I am the server and I send SOAP xml messages ...
1
vote
1answer
70 views
Multi threaded and event driven [closed]
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 ...
1
vote
1answer
125 views
Need Async/Await equivalent for BackgroundWorker
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 ...
0
votes
1answer
84 views
What is the difference between running two blocks of code on the same thread and running them on two synchronous threads?
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 ...
54
votes
8answers
8k views
Are events only used for GUI programming?
Are events only used for GUI programming?
How do you handle in normal backend programming when something happens to this other thing?
2
votes
2answers
262 views
Using asynchronous calls for heavy IO operation: How to prevent crushing the CPU?
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 ...
6
votes
1answer
617 views
API Gateway (REST) + Event-Driven Microservices
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 ...
2
votes
0answers
166 views
Using and designing asynchronous APIs with naturally synchronous parts
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 ...
0
votes
0answers
118 views
Is there a ddd approach for sending events about embedded aggregate 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 ...
0
votes
0answers
38 views
Handling error with Promise
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 ...
0
votes
2answers
104 views
Method to mask variable names in C++ files (cpp, h) and create an intermediate API?
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 ...
3
votes
1answer
166 views
Is there use case for implementing a callback if a future is returned?
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 ...
4
votes
1answer
308 views
“Reactive programming is programming with asynchronous data streams.” is this true?
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 ...
0
votes
4answers
202 views
Callbacks without concurrency? [closed]
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 ...
1
vote
3answers
282 views
Use case for async/await?
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 ...
4
votes
1answer
128 views
Trying to understand some async/await behavior
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 ...
2
votes
3answers
84 views
What is the right architecture for scalably scheduling and managing frequent periodic asynchronous?
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 ...
1
vote
1answer
231 views
Async I/O operations - proper way to avoid deleting object
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 ...
2
votes
3answers
620 views
Writing new code in async but calling sync
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 ...
0
votes
0answers
52 views
Merging waitable objects
Lets say you have two (or more) objects from which both allow a thread to wait for an event to occur.
Foo.Wait(timeout);
Bar.Wait(timeout);
The main thread wants to wake up when either of these ...
-1
votes
1answer
46 views
How to name functions which continue a process after an asynchronous step
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 ...
2
votes
1answer
88 views
Would the APM be faster or more efficient than TAP?
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 ...
0
votes
0answers
65 views
can a parallel queue empty itself?
Is there a way to accomplish this pseudo-code in C# in .NET4.5?
parallelQueue.attemptDequeueFirstItem(item)
success -> ( doAsyncTask(item).Success(UpdateDatabase) )
...
5
votes
2answers
198 views
Synchronous facade hiding asynchronous web service
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 ...
1
vote
1answer
292 views
HTTP Async/Await Task: avoid flooding server with requests?
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.
...
1
vote
0answers
179 views
Is the logic behind `Asyncio.wait()` and async/await, the same, just the code is written differently (syntax)?
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 ...
47
votes
1answer
15k views
Is there really a fundamental difference between callbacks and Promises?
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 ...
4
votes
1answer
436 views
UML: Should an asynchronous request-response message exchange be modelled as two ports/interfaces or one
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 ...
0
votes
1answer
263 views
Do any languages have syntax for promises? [closed]
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 ...
0
votes
0answers
156 views
Broadcasting events asynchronously in a high frequency application to prevent hangs?
I'm doing a bit of socket.io work in an application that demands high frequency updates with minimal wait times (imagine a commentator annotating a video livestream, with viewers both watching the ...
5
votes
1answer
616 views
Best practice for parameters in asynchronous APIs in Java
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 ...