Newest 'asynchronous' Questions - Stack Overflow

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
1answer
36 views

How to resolve the Syntax error : await is only valid in async function?

I have written a code to return some data from asynchronous call using promise. While I try to execute I get "Syntax Error await is only valid in async function" and also I get Cannot proxy ...
1
vote
0answers
15 views

How do I use RWLock to implement many readers-one writers scenario right?

I'm trying to write a method which process some messages. They can be read or write messages. Parallel reads are permitted, but when write lock is aquired all subsequent read lock should wait until ...
0
votes
0answers
29 views

How can I show images from one div only after the images from another div became hidden?

I am using jQuery to display/hide inner divs from outer divs on mouseenter/mouseout event. The number of inner divs per outer div differs, and multiple inner divs are shown in a sequence, one by one ...
5
votes
1answer
64 views

Displaying results as soon as they are ready with std::async

I'm trying to discover asynchronous programming in C++. Here's a toy example I've been using: #include <iostream> #include <future> #include <vector> #include <chrono> #...
0
votes
0answers
4 views

Async/await function in mongoose

const mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/mongo-games') .then(() => console.log('Now connected to MongoDB!')) .catch(err => console.error('Something ...
1
vote
3answers
21 views

Should I save data to DB asynchronously

I'm using node express and postgress. I'm not sure if what I'm trying to do is a good practice or a very big mistake. Save data to database asynchronously after I already return a result to the client....
0
votes
1answer
14 views

How to get specific request to be Served by Specific application (among multiple running Apps) in a POD in Kubernetes?

I have a Client-Server based application where my clients are available in a Kubernetes as PODs. Here, Clients-Server communication is Asynchronous. Assume I have five PODs of my client app (POD1, ...
0
votes
1answer
28 views

NodeJs + Async + Google auth + passport + aws-ssm

I am using nodejs and implemented the google-auth using passport npm module. But I am fetching google api-key and secret-key fetching from the aws:ssm parameter like server call.. But the problem is ...
0
votes
0answers
10 views

Gulp webp function not respecting watch command

Ok, so I am using the typical image minification process. I have functions for jpg, pngs and I have a separate function to convert those to webp. I have the following gulpfile (only the relevant ...
0
votes
1answer
16 views

Assigning value inside query and it is not updating

I am trying to do update an array "projects" depending on a query to a db forEach value from the array. When I get the value and assign it to the current index of the projects, it does not update on ...
0
votes
0answers
44 views

How to Receive JSON data back from HTTP request, not sure how to get JSON values?

After receiving my access token from post, can't seem to figure out how to get values/data from json. The code I have so far does a post of the access token in my URL: localhost:59185/api/values Click ...
0
votes
1answer
35 views

How to speed up Api Controller Response using asynchronous code to run another task when a request is received?

In my api controller, I have a method called "SendMail" that receives a post with a json body that looks like this: { "MailTo": "abcdefg@hijklmn.opqrst", "Subject": "This is the subject", ...
0
votes
0answers
16 views

AsyncHttpClient won't let program exit

I'm using org.asynchttpclient.async-http-client version 2.2.0 in the following code: public class Application { public static void main(String[] args) throws InterruptedException, ...
0
votes
0answers
26 views

Dart For Loop is exiting before async function is completed

I am uploading images via multipart request one at a time to the server. Each time I send an image I am listening to the response for a success message. If the returned JSON["status"] == "Success", ...
0
votes
0answers
9 views

Issue: Loading graphic displays AFTER data has processed, rather than before

Having a hard time getting a loading graphic to display BEFORE processing some data. Currently the graphic only shows up AFTER all of the processing is done (when I comment out this.showLoader = false)...
0
votes
1answer
26 views

How scala implicit make abstract method valid parameter so I can use method in java

So this is a bit of a strange question, but I am trying to make use of a piece of code that is in scala and takes a set of parameters. In scala the parameters are implicits so scala is able to do its ...
1
vote
1answer
24 views

ServiceStack: async/await service handlers

I have read a few SO questions that touches in this question, even though many of them are several years old: How do you write a Service handler in ServiceStack API so that it becomes async/await? ...
0
votes
0answers
40 views

Promises: Does nodejs have a stack who puts who is next when the current function is completed? [duplicate]

I Have this simple code: (async () => { console.log("start"); let flag = true; let promise = new Promise((res) => { while(flag) {} console.log("finish promise"); ...
1
vote
1answer
26 views

Can't handle exceptions in async method in Debug on Windows 7

I'm struggling weird problem that occurred only in debug mode on Windows 7. I'm try to catch exception that I'm throwing in method delcared async. Yes, I'm awaiting it, but exception still stands ...
0
votes
0answers
21 views

Call functions output in another function and use certain function twice but with different parameters [duplicate]

I am trying to wrap my head around node JS and its idea of asynchronous action's. I am setting up a web server with node JS and Express, where the server takes two pairs of x,y coordinates and sends a ...
0
votes
0answers
28 views

Merging lists from CompletableFuture

I have a number of CompletableFuture objects: List<CompletableFuture<List<String>>> allFutures = new ArrayList<>(); allFutures.add( CompletableFuture.supplyAsync( () -> ......
-3
votes
1answer
50 views
1
vote
1answer
33 views

Problem with promises and asynchronous operations

I have to make an HTTP POST request to the server, wait for the server response and then make another request (which will send some data of the server response back to the server). I thought it was an ...
0
votes
0answers
30 views

Asynchrony problem trying to recursively call an API

I'm trying to build a dictionary based on the API calls that I have to do, giving to the API a given id for each call. After this process, I need to operate on the generated dictionary. The problem is ...
-2
votes
0answers
51 views

Can converting a web application to async/await make servicing of the requests slightly slower [duplicate]

We have a standard .NET core web api application, where we have some IO steps in its workflow but its implementation is all synchronous e.g. Go to the database and get stuff (using Mongo c# library ...
3
votes
2answers
28 views

Extracting Data from Asynchronous Function for UITable Return

I have a function called gatherData, which iterates through directories and data on a Firebase database. Because it uses asynchronous functions, I returning the data wasn't an apparent option. I used ...
0
votes
1answer
64 views

Task.WaitAll and HttpClient.GetStringAsync with identifier [on hold]

I am trying to use Task.WaitAll with HttpClient and be able to identify each url when the results come back but I am not sure how to formulate the code properly. I have the following: public ...
2
votes
5answers
62 views

Prevent static property being accessed before async function initializes it

I have a function that asynchronously loads a xml file, parses it, and adds certain values to a list. I'm using async and await for this. The issue I've run into is that after calling await the ...
0
votes
0answers
33 views

¿How can i use various javascript files in different app pages?

I'm trying to do an ionic app, this ionic app was built using the sidemenu template: ionic start myApp sidemenu In that template I did a gallery, this gallery has as many ionic radio buttons as ...
-4
votes
0answers
27 views

Looking for a solution to run multiple GET requests at the same time and tracking each requests' status [on hold]

I'd like to go through an array of items and send a GET request to an endpoint for each of them. We're talking about roughly 3-4000 unique requests. Currently I'm using mapLimit from async, it ...
0
votes
1answer
21 views

Async Waterfall Can't seems to read the last function

I am new to nodejs and for my database im using MYSQL. I have no idea why Waterfall Async only reads the first 2 functions but does not read the last function that is being declared. The first 2 ...
0
votes
1answer
23 views

Exception handling in StreamingResponseBody

I'm trying to catch an exception thrown in my implementation of StreamingResponseBody, I can see the exception being thrown inside the class however the thrown exception isn't visible to the method ...
0
votes
1answer
34 views

Promise implementation problem, asynchrony not working properly

I'm implementing a web-app and I need to code some steps in an asynchronous way. On one of these steps I'm calling an API to extract a list of ids from a 3D model, then, I need to use this as a ...
0
votes
0answers
21 views

SetTimeout executing multiple times with a single event

I'm using socket to fetch data from backend, which is used to render my chart.js bar chart. The objective is to delay the time between each bar that is getting rendered in the graph. I used setTimeout ...
-2
votes
0answers
17 views

Return JSON from Ajax and assign to a variable [duplicate]

I have an API that returns a JSON object with info about servers connections (more precisely ice servers): {"v":{"iceServers":{"username":"...
0
votes
0answers
19 views

Async annotation and parallel processing

Here is the environment first: A service publishing high amount of messages to a queue. This is a Spring boot application running in a container and I have access to it (means it is possible to ...
-3
votes
0answers
20 views

Async Function - Return Object After Task Is Complete [duplicate]

I have the function below, it started life as non-async and applications was returned correctly. Now the return call is being hit before the task above is complete, I need to be able to return ...
0
votes
0answers
12 views

Halt loop execution until asynchronous function is called back

I'm using expressjs framework and trying to send text messages to an array of textMessageNumbers numbers using request package. for(let i = 0; i < textMessageNumbers.length; i++) { request('...
0
votes
0answers
21 views

Set up my webpage to be able to accept multiple speech inputs sequentially, after the previous one has processed

I have a form on my page with multiple input fields (multiple checkboxes). I want to enable filling the form via a voice input. The approach I came up with is: 1. The question text is read out 2. The ...
-1
votes
0answers
58 views

Async call with awaited Semaphore create Deadlock

From last few days, I am facing an intermittent deadlock from the below code snippet, It occurs only when we use async call, my Api call hangs for infinite period of time, the worst thing is I am not ...
0
votes
2answers
36 views

How to make a forEach loop wait for regex substitution?

I am working on an email web app where I try to replace certain keywords (first name, last name, email) with the actual properties of the user. Currently, I am looping through a list of recipients and ...
0
votes
1answer
38 views

Is there a way to process Async process response as they get completed in Spring Boot micro services?

Suppose we have 5 different service calls in a single function and all are asynchronous, I want to process each of them as they get completed. As example these are 3 different functions available in ...
1
vote
1answer
25 views

Create synchronous loading of data using D3.js and drawing following the loading

I have reached a stage where I believe I am not understanding the correct callback of events. I am utilizing d3.js v5 and my issue is as follows. I have a function which parses a tsv file and adds ...
0
votes
0answers
13 views

Global Unchecked Exception Handler for CompletableFuture runAsync() methods

I have some async code across my spring project that looks something like this: public void someFunction(int param){ CompletableFuture.runAsync(() -> someService.execute(param),executor); } I ...
-2
votes
0answers
24 views

Assign address of Task Result to Class

VB2017: I am cycling through sections in a webpage and parsing out several tables to HTML nodes. This takes quite some time so I am running the conversion async from source to HtmlNodeCollection. I ...
0
votes
4answers
22 views

When called inside a function with parameters passed from parent, why is the setTimeout function logging undefined?

I have been working with the asynchronous function setTimeout in javascript. The following code gives different results when the parameter is passed in one setTimeout function and not in another. Can ...
0
votes
2answers
48 views

How do I make my UI not Freeze while background code is running C#

So Im trying to make an app that can execute functions send from a client it works fine but the UI freezes while its listening for a message from a Client what do I have to change to make this code ...
1
vote
3answers
40 views

Get data from a promise. Or is it promise at all?

I store some data in IndexedDB and i use npm package localforage for it. const retrieveData = async () => { const keys = await localforage.keys() const data = await keys.map(async (key) => ...
0
votes
0answers
20 views

Dynamic Imports with NuxtJS and VueJS

I want to create dynamic pages in nuxtjs. My Content is stored in markdown-files located in content/faq/. So i need dynamic imports to import the correct file based on the param.slug variable. How can ...
0
votes
1answer
12 views

Firestore: Calls with of async function with SnapshotListener and in a cycle with DispatchGroup cause a crash

I have an issue with using DispatchGroup (as it was recommended here) with FireStore snapshotListener In my example I have two functions. The first one is being called by the ViewController and ...