The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
30 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
78 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 ...
52
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?
1
vote
1answer
104 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 ...
1
vote
1answer
80 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
75 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
38 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
21 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
64 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
71 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
90 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
110 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
137 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
100 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
72 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
135 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
173 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
48 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
38 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
79 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
53 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
128 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
191 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
136 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 ...
23
votes
1answer
4k 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
218 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
218 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
82 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
359 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 ...
4
votes
1answer
251 views

How is one supposed to deal with the intermediate buffer of DataReader class?

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 ...
1
vote
1answer
396 views

How should I handle the fetching of cached data in iOS

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 ...
4
votes
1answer
527 views

C# async/await: Pedantry vs. the Debugger

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-...
5
votes
1answer
2k views

Does Akka obsolesce JMS/AMQP message brokers? [closed]

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 ...
2
votes
2answers
301 views

Reading using non-blocking IO on a fd asynchronously in C++ (moving from Node.js)

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 ...
3
votes
1answer
95 views

Connection between futures and exceptions?

Is there a connection between futures and exceptions? async-await looks very similar to throw-catch.
3
votes
2answers
256 views

Async library guidance

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> ...
2
votes
1answer
325 views

JS Async: . Can I forget callbacks all together and replace with promises and/or generators [duplicate]

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 ...
1
vote
1answer
137 views

Mixing reactive programming with non-reactive return requirements

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 ...
2
votes
2answers
870 views

Blocking function call with asynchronous content

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 ...
9
votes
1answer
478 views

When asynchronous tasks make a bad UX

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 ...
1
vote
1answer
104 views

Equivalent translation of Asynchronous behaviour in C

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 ...
3
votes
1answer
987 views

Implementation of Asynchronous function call in C

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 / ...
1
vote
1answer
1k views

C#/.NET multithreaded application design

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 ...
-3
votes
1answer
361 views

using node.js server with mysql-module and PHP for a penny-auction website? [closed]

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 ...
7
votes
1answer
403 views

Language compiled to JS – most elegant way to do synchronous-style waits

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 ...
0
votes
1answer
162 views

Can you refer to the callback function as an API?

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 ...
1
vote
1answer
2k views

Using $timeout to normalize response time of a webservice call (Best practice question)

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 ...
1
vote
1answer
261 views

Experiences with C++ Async/actor model Library [closed]

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 ...
2
votes
1answer
99 views

What are the underlying patterns in systems allowing asynchronous operations?

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 )...
0
votes
2answers
124 views

When are nonblocking read or receive operations useful?

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 ...