27,816 questions
1
vote
2
answers
64
views
How to invoke showdialog in asynchronous contexts?
I am making a flutter app to interact with SQLite database.
As I was implementing the feature to add a record(a row), I wanted to add the row to the database if it follows the constraints, but if ...
2
votes
3
answers
121
views
Migrating Python generators to async/await
The original version of this question asked about using generators concurrently in the asyncio even loop. The helpful commenters pointed out how awkward that would be. The intent of the question was ...
-1
votes
0
answers
41
views
Can't get synchronous result from IJSRuntime.InvokeAsync()
Here is some code:
App.razor
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="...
1
vote
1
answer
59
views
How to execute async code for thread-locals in a non-threaded environment?
I need to execute an async function for a thread local. The minimal example:
use std::cell::RefCell;
thread_local! {
static REQUESTS_CHECKER: RefCell<()> = RefCell::new(());
}
async fn a() ...
-3
votes
1
answer
68
views
I apparently hit a Rust bug, what to do?
I apparently hit a Rust bug. The minimal example:
use std::cell::RefCell;
thread_local! {
static REQUESTS_CHECKER: RefCell<()> = RefCell::new(());
}
async fn a() {}
async fn b() {
...
0
votes
0
answers
16
views
How do deal with 'setImmediate()' function when migrating callback function to async await?
I am trying to migrate old legacy NodeJS code that looks like:
function x(data, callback) {
doSomethingWithData(data);
if(data.x) {
setImmediate(callback, "A");
}
...
0
votes
1
answer
62
views
How to connect FastAPI with PostgreSQL using SQLAlchemy and async sessions?
I’m building a small project using FastAPI + PostgreSQL and I want to use async SQLAlchemy sessions for queries.
I’ve seen examples with SessionLocal, but I’m confused about how to properly set up:
...
2
votes
1
answer
34
views
Allowing debugging in a .NET Framework 4.7.2 async Windows Service that uses Quartz.Net
I have been trying to properly implement debugging for a .NET 4.7.2 Windows Service that uses Quartz. I've used Nito.AsyncEx to start and stop the Quartz scheduler inside of ServiceBase's OnStart and ...
1
vote
0
answers
38
views
Resolve promise in a typescript non async function [duplicate]
I have a typescript file with the following non async function.
export function MSALInstanceFactory(): IPublicClientApplication {
const environmentService = new EnvironmentService();
const ...
0
votes
0
answers
81
views
Define execution hand-off point in .NET Core [duplicate]
I'm developing a simple web app that will (roughly) do the following:
Receive request to do something
Send back an acknowledgement response
Call the function that does the thing (the "execution ...
2
votes
0
answers
33
views
Understanding how @MainActor executes background-tasks [duplicate]
The function 'refreshAllServers' is annotated with @MainActor:
@MainActor
private func refreshAllServers() async {
defer {
queueRefresh()
}
guard servers.isEmpty == false
else {
...
0
votes
3
answers
130
views
Should I write "Task.Run()" in the controller's called method?
I have a controller with async Task<IActionResult>, and I call a method using await. In the method, the fund portfolio is read from a file. This should happen asynchronously. Ideally, of course, ...
0
votes
1
answer
106
views
Return timing of dart `Future` objects in asynchrounous functions
First, Please correct me anything I inferred about asynchrounous programming in dart, and even what I summarized from the docs,
And please check if my idea about when Future objects are correct. I ...
-2
votes
1
answer
54
views
How to make an async setup and teardown fixture in Pytest
I have a working basic example of a setup and teardown fixture in Pytest:
@pytest.fixture()
def setup_and_teardown():
# Setup
print('setup')
# Yield some variable to the test
...
0
votes
3
answers
165
views
Threading deadlocks in method but not direct code
I have a WPF app. I have to use .GetAwaiter().GetResult() at some points because my application is an addin to another application. The parent has sync calls to my code and my code has async as high ...