Category "async-await"

Response file stream from S3 FastAPI

I am trying to return a response of a picture from S3. In StreamingResponse.stream_response I see, that chunks are read from the stream and sent to the socket.

Simple practical example to see faster async functions and promises from node 10 to node 12, and up

Before I ask my question I want to make this clearly, I know benchmarks never tell the whole story. But my goal here is relatively simple, I want to see the per

How to make a Timer.periodic function fire right away after calling it Flutter

I'm trying to use a Timer.periodic function in flutter and it seems that when I call it, it waits for the specified duration that I put in for the time between

Error: socket hang up in Http Request made in Node JS using request-promise causing for loop to restart

I am trying to make an Http Request using request-promise inside a for loop. But it seems if a Http Request takes long, request-promise closes the connection.

Ballerina Swan Lake - How to alternatively wait on a dynamic set of Ballerina future values?

I have a requirement of writing a ballerina util function that can alternatively wait on a given set of futures and return the result, where the number of futur

How do I fix a "System.Net.Http.HttpRequestException: TypeError: Failed to fetch" in Blazor WebAssembly?

The code below, runs for about fifteen seconds on the "dataFs = await _Http.GetStreamAsync(BODIST_DATA_HTTPNAME)" line before failing with a "System.Net.Http.Ht

Javascript await / promise order of execution is not as expected

In my Nodejs project I would just like to await a mongoose.save function before continuing with my code. The below example does not work, but can anyone help me

async await with setInterval

function first(){ console.log('first') } function second(){ console.log('second') } let interval = async ()=>{ await setInterval(first,2000) await se

async/await "List<> does not contain a definition for 'GetAwaiter'"

I apologize for sounding dense, but I swear I have read up on async/await and played with examples, but I am still stumped at simple things like why the followi

How do I implement an async Drop in Rust?

I have an async fn that returns a type, and want to implement Drop on that type that calls another async function. It's not clear how to do this, and I can't fi

How to use Promise.prototype.finally() in async/await syntax?

Actually my main question was using Promise.prototype.catch() in async/await ES8 syntax, Undoubtedly Promise.prototype.then() is existed in essence of async/awa

How to correctly structure a nested node-fetch request to avoid Promise<pending>?

I'm attempting to Fetch GET my website (with node-fetch) Scrape it with Cheerio to get specific posts Fetch GET from my CMS (with node-fetch) to check if there'

What does the suspend function mean in a Kotlin Coroutine?

I'm reading Kotlin Coroutine and know that it is based on suspend function. But what does suspend mean? Coroutine or function gets suspended? From https://kotli

await & async when you don't care about errors

Let's take a simple example, fs.stat. I can promisify fs.stat and write: const stats = await stat(file, fs.constants.R_OK); but if the file doesn't exist this

Difference betweeen Two line of same code

can someone explain to me the differenec between the two line of code. In my atom editor the prettier changes the first to second. (await fetchSearchResults(sta

Best Practice winforms async/await keywords

Testing a bit TPL. I use this code and it works: async void button1_Click(object sender, EventArgs e) { MyClass2 mc2 = new MyClass2(); la

The return type of an async function must be the global Promise<T> type

Why does TSlint still says "The return type of an async function or method must be the global Promise type"? I can't understand what's wrong. UPDATED:

Using chrome.tabs.executeScript to execute an async function

I have a function I want to execute in the page using chrome.tabs.executeScript, running from a browser action popup. The permissions are set up correctly and i

What are asynchronous functions in JavaScript? What is "async" and "await" in JavaScript?

This Q&A is aimed to give clear answers to the following questions: What are asynchronous functions in JavaScript and when and how do we use them? What are

How to solve async-await function problem while using Axios?

I want to use axios using async await function. But when I use async await function then I get an error. useEffect(async() => { await axios .get("