Questions tagged as 'async-await'

7
answers

In C #, what is the key word await?

I was studying this documentation on Asp.net Identity , and the examples in C # have a keyword that I do not know, which is await , example: [HttpPost] [AllowAnonymous] [ValidateAntiForgeryToken] public async Task<ActionResult> Re...
asked by 29.01.2014 / 17:36
1
answer

How does ES7 async / await work?

ES7 allows you to use a new syntax to work with Promises known as async / await functions. How can I use these functions and how are they compared to functions that use Promises to process data sequences and in parallel?     
asked by 24.08.2016 / 00:41
2
answers

Async / Await with threads (C # 7.2)

I have this code and as you can see I created two examples, Parallel and NotParallel. I was hoping that both of them would return me 3000ms, as both should run async (2000 and 3000) and the total time would be 3000, but the NonParallel, is ta...
asked by 20.04.2018 / 14:24
2
answers

Json API access problem with React

I'm trying to access the following Json variable in an API: page[0].infoBloco[0].tabela[0].dados[0].fonte.nome I'm getting the error: TypeError: this.state.page[0] is undefined[Learn More] index.jsx:49 The Json API returns: [ {...
asked by 19.06.2018 / 15:36
1
answer

Why can not I capture exceptions triggered by async void?

Why can not I catch exceptions triggered by asynchronous methods that do not return Task ? public async void calcularPrecos() { var tabelaPreco = await getTabelaPreco(); /* Blá, blá, blá... */ } public void iniciarCalculos() {...
asked by 25.08.2016 / 04:12
1
answer

How to use async and await in NodeJs

I'm trying to learn how to use async await but, I'm missing something and need help. My method works as expected with Promise see: import express from 'express'; import conn from '../models/connection'; const c = conn; class ClientRoutes { ....
asked by 17.07.2018 / 21:37
1
answer

Error passing parameter through GetAsync method

How do I pass the login object as a parameter to the GetAsync method? I'm trying to do it this way, but I did not understand the error message: private async Task<JsonResult> obterLogin(Login login) {...
asked by 27.07.2018 / 15:43
1
answer

How to use async / await in get request using vue + axios?

I have the following code and would like to know how I can implement a try / catch with async / await executing the same function: import Vue from 'vue' import axios from 'axios' new Vue({ el: '#app', data: { skills: [], }, mounte...
asked by 20.05.2018 / 19:08
0
answers

C # Async / Await with an Invoke?

Good people. I have a small problem, I have a Window to serve only to send information to the user to say what is happening in Background, but sometimes the code runs fast and more and he does the close before opening the window. Remember tha...
asked by 28.11.2018 / 17:26