Questions tagged [asynchronous]

Asynchronous programming is a strategy for deferring operations with high latency or low priority, usually in an attempt to improve performance, responsiveness, and / or composability of software. Such strategies are usually employed using some combination of event-driven programming and callbacks, and optionally making use of concurrency through coroutines and / or threads.

0
votes
0answers
9 views

RXJS Chain responses from resolved data, filter data and infinite scroll data

There are 3 different UI/UX elements that affect the data the user sees in the application. The first one being the resolved data from the resolver. Second one is the concatenated data from the ...
0
votes
0answers
7 views

Microservices communication over Kafka

I have 4 services and I need to implement the communication from each other using asynchronous messages over Kafka, but I have doubts about how many topics to do this. I need to implement the SAGA ...
0
votes
0answers
6 views

Spring Data Repository Async Save

I have a service using Spring Data Redis and the CrudRepository, and within one of my service methods it performs a query and then a save. I want to make the save asynchronous. Is it possible to make ...
-1
votes
1answer
40 views

Waiting for all jobs to be finished with async await

I'm trying to understand the usage of async-await in C#5. If I have 2 jobs started in a method, is there a best way to wait for their completion in C#5+ ? I've done the example below but I fail to see ...
0
votes
1answer
25 views

Await is reserved word even when copied from MDN

I copied and pasted a for-await-of example from MDN and still get an error telling me await is a reserved word. Is this maybe a problem with my Javascript version? I've tried several different ...
0
votes
2answers
17 views

Angular7 AuthGuard Firebase Claims

I am able to login using firebase, however in my app I have 3 levels of users. Let's call them admin, user, editor. I keep user's role in custom claims provided by Firebase. In AuthGuard, I pass data ...
0
votes
1answer
30 views

Listener in a task works only one time

I have written a complex class called DonationListener. This class has a property named onDonation that takes a function that will be called when a donation happens. In a simple console program it ...
0
votes
0answers
7 views

MediaCodec Async Callback is not occurring if other thread has blocking wait

I am using MediaCodec OnAsyncInputAvailable and OnAsyncOutputAvailable callbacks introduced in API 28. void OnAsyncInputAvailable( AMediaCodec *codec, void *userdata, int32_t index) { ...
1
vote
1answer
24 views

How can i send files asynchronously in a client-server application?(using winsock2.h, in C)

I want to send files asynchronously. I got on sending a file client->server->another client, but if i want to send a very big file, the client can't send any other commands to server until the file is ...
0
votes
0answers
21 views

How observable creates stream of events internally?

I am trying understand the internal implementation of obseravbles. We know observables create stream of asynchronous events over the time. We have to subscribe the observable to get the value. How ...
-1
votes
0answers
28 views

JavaScript identifying if directory traversal function completed [on hold]

I'm new to JavaScript and I have written a async recursive function to traverse all founded sub-directories from root, but I have no idea how can I determine if the async recursions are finished. ...
0
votes
0answers
27 views

Running Powershell scripts asynchronously in C#

I'm trying to rework an existing C# Winforms tool. The idea is to use Powershell for specific commands to computers. I have a BindingList which will be filled with ADComputer objects on button click, ...
0
votes
0answers
23 views

Nodejs async good practices

Imagine you are creating a framework for nodejs. Is there any good practices to handle sync/async code. I'm talking about the sync-to-async problem as follows: All over your libraries you have code ...
1
vote
0answers
10 views

How to use result of one threaded function in another deferred thread twisted

My Twisted server code: @app.route("/output", methods=['GET']) @inlineCallbacks @authenticate def predict(request): request_params = request.args logger.debug("request param are {}".format(...
0
votes
0answers
24 views

How to store user input as a variable in an async function in node.js

Basically I am looking for a substitute to var x = prompt("Question") inside of an asynchronous function specifically for node.js. Does such a thing exist? I have tried dependencies such as inquirer ...
0
votes
1answer
34 views

Get result from chilkatHttp.PostUrlEncodedAsync in VB6

I am using chilkat Http.PostUrlEncodedAsync to send some data to a server and get a JSON response. When the Http_TaskCompleted Event is fired, the task.ResultType returns "object" but there is no task....
0
votes
1answer
12 views

Asynchronous programming and interrupts exception handlers

I'm new to programming, just a question on how asynchronous programming actually works. We know that interrupts occur asynchronously as a result of signals from I/O devices that are external to the ...
0
votes
0answers
11 views

How to communicate Django custom API with another process?

I've searched for a solution everywhere but I just can't find anything that accomplishes what I need. The problem is the following: I have a Django server that listens to requests, said requests are ...
-1
votes
2answers
65 views

Bubble up Exception from Task.Run()

I have the code below and I am trying to bubble out the exception coming out from testFunction(). When i try to run the code there is no exception thrown. testFunction is a task which i want to call ...
2
votes
0answers
73 views

Making F# MailboxProcessor tail recursive

I'm reading about F# tail calls and I want to optimize a MailboxProcessor: type printerAgentMsg = | Message of string | Shutdown of AsyncReplyChannel<unit> let printerAgent = ...
-4
votes
2answers
67 views

Is this the correct way to make 4 methods run at the same time async?

Is this the correct way to make 4 methods run at the same time async? Version 1: public void startup() { var aTask = Task.Run(async () => { Console.WriteLine(...
2
votes
1answer
26 views

An AsyncDuplicateLock that can be locked on all keys

I need a lock similar to the one from this answer from Stephen Cleary: http://resolved-error.com/a/31194647/4381408 However, I also need to be able to lock on all keys at the same time. I'm using ...
0
votes
0answers
13 views

Trying to respond to Slack depending on response other API

I'm have difficulties of responding to Slack using Node Red. The response should wait on the response of another REST call. I guess I need something with async await? But I can't figure out how to ...
-1
votes
0answers
30 views

JavaScript wait until function call is finished before starting next one [duplicate]

I currently use an array of aEdits based on which I call the functions _updateStatus and _updatePlanning. The problem is that our system currently does not allow multiple calls to occur at the same ...
0
votes
0answers
16 views

Show loading bar (progress bar?) while get my location using a service class

I´m creating an app to show map and get my current location. I´m using GPSTracker API. It is a service. I need to put a loading (progress bar or another kind of loading) to user wait while GPSTracker ...
1
vote
0answers
15 views

Tweepy's StreamListener combined with Async

I am trying to implement a StreamListener from the Tweepy library to like tweets with certain keywords, which works, except that my program never proceeds once it hits the StreamListener, it just ...
1
vote
2answers
37 views

AWS Lambda not invoked when using 'Event' invocation type

I have 2 lambdas, test1 which invokes test2. I want to invoke test2 asynchronously with the "fire and forget" mentality. Below is the code for both lambdas. When I set the InvocationType to ...
0
votes
0answers
24 views

socket.io control execution order with nested async and await

In my app, I have multiple users submitting data "at once" via a socket.event. Because I need to know if every user has submitted their data successfully, I try to indentify the first and last entry. ...
0
votes
1answer
16 views

Vanilla JavaScript async multiple xhr.open()

I would like know how to handle multiple xhr requests with vanilla JS. I want to open multiple html templates and load the page when all of them are ready. when I use few xhr.open() requests it will ...
0
votes
1answer
36 views

Angular 7: Custom Async Validator

I'm trying to create a custom async validator for my registration form where it checks if an email already exists. The backend returns 404 if the email does not exist and 200 if it does exist (can't ...
0
votes
1answer
12 views

Is there a pattern for synchronizing message queue communication to request/response manually?

Let's imagine I have a REST API with an endpoint /api/status. When this endpoint is accessed, the API sends a message to a message queue requesting the status of some other service. Then in reply, ...
1
vote
1answer
19 views

Do we need to re-factor Microserivces

We have created our application based on Microservice architecture and contains about 30 Microservices. Almost all inter-service communications is synchronous and they call each other directly. Now ...
0
votes
3answers
49 views

How to break chain in promise

I'm trying to limit the number of apis fetches in my project by saving them in a simple cache, key collection in mongodb. Is thera way to stop propagation of .then() inside Promise, without using ...
-1
votes
0answers
6 views

which one best for 'performance ,big-project & good looking & understanding code ' , callback or promise or async/await?

which one best for 'performance ,big-project & good looking & understanding code ' , callback or promise or async/await ?
3
votes
1answer
39 views

Why am I seeing “Promise { <pending> }” from this code on repl.it?

I know this question has been asked a lot on stackoverflow and I've searched a lot and still am not able to understand. async function testFunc() { var test = await getSomething(); //test....
1
vote
1answer
20 views

Synchronous/Asynchronous CD writing

I have been told to write a software to burn a CD synchronously/asynchronously as per user choice. I am using IMAPIv2 for the project, and it does not provide the functionality explicitly. In order to ...
0
votes
0answers
17 views

Firebase Admin Java SDK - Database Sync Data Retrieve

I am using: Java (Client/Server) Firebase Admin SDK (Server) Spring Framework (Server) Problem: I am trying to develop the server, based on Spring Framework that would work together with Firebase's ...
1
vote
0answers
26 views

With C++ std::async, why do we need packaged_task and promise? [duplicate]

I'm learning about C++ thread library, and I feel the async, packaged_task and promise are doing things that are pretty similar: they all run a function asynchronously in a separate thread, and return ...
-2
votes
0answers
18 views

jQuery .load() - wait until remote page is fully populated

I am trying to load a remote page, however the target page is async-populated. As a result, I loaded a page without content (or without the content I want). Is there any way to detect if the remote ...
1
vote
1answer
33 views

Main thread exits before the completion of CompletableFuture

CompletableFuture feature = CompletableFuture.supplyAsync (() -> composeMethod ( )). thenAccept (s -> System.out.println ("wassup java" + s)). thenRun (() -> ...
0
votes
1answer
28 views

what is the efficient way to reuse async function from different file location in nodejs 4.x?

This is a working sample code which call async function from different location and reuse the result with some calculation. In this case I used "Promise" two times. first Promise: get async value ...
0
votes
1answer
28 views

Execute if statement only after other processes in function are complete (async/await/promises vs observable)

In Angular 6, I'm using the function save() whenever a user enters a new record into a table on our app. Within save() we check for two things: 1. 'front end' validation errors AKA 'you cant enter a ...
1
vote
2answers
34 views

Java: Serialize object to file asynchronously

I am making a Minecraft clone, and I have a Map<Vector3i, Chunk> called chunks that stores all the loaded chunks. Every frame, this loop runs: for(Vector3i v:chunksToUnrender){ ... ...
0
votes
0answers
21 views

SmtpClient.SendAsync() and IDisposable in ASP.Net MVC5

At the end of one of my controller methods, I need to loop through a collection and fire off emails based on business rules. I do not want this process to block the return from the controller, as ...
0
votes
1answer
40 views

Cannot access array elements outside loop

I have this endpoint in node js and express, that adds students to an array. I pass the class name and an array of emails in the body of the request. The logic goes as follows: Search whether the ...
1
vote
2answers
70 views

Correctly implementing Tasks in a WPF application

I'm looking for some advice on getting to grips with Tasks in WPF and was wondering if anyone could have a look over my code and point out what I'm doing incorrectly? Basically the application takes ...
-1
votes
0answers
25 views

Why should I wrap entire contents of async express middleware inside try catch block?

When I create an async express middleware, why do I have to put entire code that is inside express middleware around a try-catch block and not just situations where promise can reject (like mongoose ...
1
vote
1answer
48 views

Maximize number of parallel requests (aiohttp)

tl;dr: how do I maximize number of http requests I can send in parallel? I am fetching data from multiple urls with aiohttp library. I'm testing its performance and I've observed that somewhere in ...
1
vote
1answer
31 views

Self-sizing UICollectionView cells with async image loading

I have a horizontal UICollectionView in which I display images that are loaded asynchronously. The cells are supposed to have their width fit the image. In viewDidLoad of my view controller, I set ...
0
votes
0answers
15 views

Manage asynchronous operations inside javascript loops [duplicate]

I have a script in Node JS, that loops inside an array; for each element of the array I have an url to be used to download a file. As you can see I will keep track in case of downloading error, and at ...

http://mssss.yulina-kosm.ru