51,990 questions
-1
votes
0
answers
38
views
Asynchronous thread is not able to obtain updated repository information [closed]
Application.properties
custom.async.executor.corePoolSize=3
custom.async.executor.maxPoolSize=5
custom.async.executor.queueCapacity=2
custom.async.executor.threadNamePrefix=serverAsyncThread-
custom....
-3
votes
0
answers
18
views
marketo form validation with fetch [closed]
I added a fetch function to do some hidden validation on a marketo form. The external field returns true or false. The form always submits even when validation fails.
form.onSubmit(async function(form)...
1
vote
1
answer
80
views
Mock not called by subprocess
An instance of class A starts a sub-process that calls a method of an instance of class B. It works as expected in real-life, but unit tests fail because the mock object replacing the object of class ...
1
vote
2
answers
83
views
Unable to create a web driver object if the selenium container is stuck in the middle of a session
I have the following piece of code that I use to create web drivers for my Spring Boot application.
public RemoteWebDriver createDriver() {
ChromeOptions options = new ChromeOptions();
URL ...
1
vote
1
answer
134
views
Race condition with ordered send queue in ASIO
I have the following code using the C++ ASIO library that's intended to ensure messages are not interleaved on the socket being written to (as discussed here):
#include <boost/asio.hpp>
#include ...
3
votes
2
answers
165
views
Managing async Tasks when shutdown occurs in .NET apps
I have the following class called MessageSaver in a dll called MessageSaver.dll. This dll can be used by a .NET app for saving messages to a text file. The .NET app could be a Winforms app or a WPF ...
2
votes
1
answer
58
views
Understanding error handling with Promise and async functions
The code below has a bug I can't understand.
I have 2 implementations of consumer. The first one (consumer) works fine when the callback Promise is rejected, and the error is caught by the outer main ...
0
votes
0
answers
50
views
Serializing complex data to flatbuffer multithreaded gives endless type errors
I'm working on a reasonably complex project that is using flatbuffers to serialize data to be used through FFI. The project incorporates several languages, but most of the heavy lifting, including ...
-2
votes
1
answer
98
views
How to implement async task version of function [closed]
I'm reasonably new to C#, I am using Microsoft Visual Studio Professional 2022. I have a function:
static bool sblnSendPacket(byte[] arybytPacket) {
const string cstrServer = "localhost"...
0
votes
0
answers
77
views
C++ TDLib client loops without stopping for std::getline when waiting for phone number input
I'm working on a C++ program using TDLib
to log into Telegram. I want to prompt the user for their phone number, verification code, and 2FA password.
However, the program loops infinitely and never ...
0
votes
0
answers
43
views
Losing MDC in Quarkus ManagedExecutor
I'm starting an async-process through a REST request. As soon as the REST requests returns, I'm losing the MDC context inside my async execution code. I tried to "copy" it over with ...
1
vote
0
answers
65
views
NG 21 + Vitest + Non-standalone component with async pipe
With Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. I get the following error:
X [ERROR] NG8004: No pipe found with name 'async'.
To fix this, import the "...
-3
votes
0
answers
121
views
In UIKit, is the behavior of detached Task exactly as described in this example?
I have this code:
func drawCount() {
Task {
await _drawCount()
}
}
func _drawCount() async {
let k = await Task.detached(priority: .low) {
return gfed.filter{$0.blah}....
1
vote
0
answers
58
views
How do I create a lazy asset loader in bevy?
I want to load assets from a custom zip-like format, or even GoldSrc WAD3 files.
My initial attempt was to use a custom AssetLoader, but I'm not feeling comfortable having to load the entire file's ...
0
votes
1
answer
82
views
I have two simple Python functions with time.sleep and reading data so I/O-bound but I don't get expected behavior from threading and asyncio
Previously I had a question on an example of multiprocessing which you can see in the following link
I used a 2 workers pool to split a sum in a function with Python multiprocessing but the timing ...
3
votes
0
answers
97
views
Can I modify host data after cudaMemcpyAsync
Can I modify host data in host_data_ptr after the following ?
cudaMemcpyAsync(device_data_ptr,
host_data_ptr,
size,
cudaMemcpyHostToDevice,
...
Best practices
0
votes
6
replies
136
views
Difference between await and .ConfigureAwait(true)
I understand that ConfigureAwait(false) prevents capturing the current synchronization context, allowing the continuation to run on any available thread.
However, I’m not clear about if there is any ...
0
votes
0
answers
49
views
Making gradio to refresh itself without blocking
I have this backend:
from fastapi import FastAPI, HTTPException
import uuid
import asyncio
import random
import time
from loguru import logger
import redis
from contextlib import asynccontextmanager
#...
Advice
0
votes
1
replies
54
views
Flink - Async IO Threads required
we are using Flink's AsyncIO function with Futures to make external gRPC calls. Currently, we have set the async capacity to 1, and we are using a blocking stub to make those calls. For each event, we ...
4
votes
4
answers
360
views
Task.Delay versus custom DispatcherTimer-based delay in WPF
I have a WPF project, and in some of the async event handlers in the WMain.xaml.cs I am using the Task.Delay method to suspend the execution of the handler. Example:
private async void Window_KeyDown(...
Advice
1
vote
4
replies
86
views
Which paradigm and tech stack for an app that listens to messages and updates shapes on a satellite map
I am taking advantage of StackOverflow's new "General advice" question type to present my use case and ask for technical guidance.
I am a Data Scientist with several years experience in ...
0
votes
1
answer
51
views
while task inside @Async cannot be stopped with @PreDestroy in Spring Boot
I have a Problem with asynchronous methods that run on a customTaskExecutors. In the run method I never reach the last log.info that the thread is finished running (where I would usualy put other ...
-2
votes
2
answers
130
views
Waiting for coroutine to end it's job to trigger an event [closed]
I have an Activity that is responsible for creating a new entry in the database. In this activity, a button launches a coroutine to do all the database-related stuff, and when it's done, navigate to ...
-3
votes
1
answer
132
views
Console.ReadLine in a Task causing side effects [duplicate]
I want to loop and ask user if he wants to continue. If no answer for a while, loop anyway.
while (true)
{
Console.WriteLine("\nDo you want to continue? (Type 'no' or 'exit' to break, or wait ...
3
votes
0
answers
101
views
pybind11: C++ callback from background thread to Python not executed in real time
I'm trying to expose a C++ interface and callback system to Python using pybind11. In C++, everything works as expected: the callback is triggered in real time from a background thread. In Python, ...
0
votes
3
answers
126
views
Execution doesn't stop on the first await
Below code (run in: typescriptlang.org):
const sleep = async (ms: number): Promise<void> => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
async function bar(x: number) {...
1
vote
0
answers
137
views
Python Asyncio: Timed out during opening handshake
I keep getting a timeout error which I can't currently explain. I'm new to networking in Python, but I can create and interact with example websocket code. For some reason the code below hits a ...
1
vote
1
answer
169
views
memcpy_async does not work with pipeline roles
If I do a memcpy_async on a per thread basis, everything works fine, see the test_memcpy32 below.
This code prefetches data within a single warp.
I want to expand this, so that I can prefetch data in ...
0
votes
0
answers
54
views
When can I reliably query the preferred size of a GTK4 Entry upon
I have the following PyGObject code as an MWE:
import gi
gi.require_version("Gtk", "4.0")
from gi.repository import Gtk, GLib
class FontSizeApp(Gtk.Application):
def __init__(...
-1
votes
1
answer
82
views
Seastar: per-shard TCP listeners not binding or exiting silently on non-0 shards
I’m trying to start a per-shard TCP listener in Seastar, where each shard binds to its own port (6010 + shard_id). On shard 0, everything works — the listener binds and accepts connections fine. But ...
2
votes
1
answer
75
views
How to ensure webhook requests are routed to the same FastAPI worker that initiated the request
I’m working on a FastAPI service deployed with Uvicorn using multiple workers to handle voice communication with Twilio, and I’m running into a routing problem.
Current architecture:
A client sends a ...
2
votes
1
answer
105
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
110
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
1
answer
57
views
How to handle Android UI events in C++ without blocking the main thread but keeping execution order?
I’m building an Android native application where most of the business logic resides in C++.
For example, UI events like Key Press or Drag-Drop arrive on the main thread. To process them, I forward ...
0
votes
0
answers
124
views
How can I create a single function in Rust that accepts both sync fn and async fn?
I’m building a small web server in Rust and I want the server’s add_route method to accept both synchronous and asynchronous handlers ergonomically.
Goal: allow end-users to write code as simple as:
//...
1
vote
0
answers
41
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 ...
2
votes
2
answers
110
views
Why is asyncio.gather returning results in a different order than my tasks?
I’m learning about asynchronous programming in Python and testing with asyncio.
import asyncio
import random
async def worker(name):
delay = random.randint(1, 3)
await asyncio.sleep(delay)
...
0
votes
1
answer
80
views
Spawning multiple tasks but inner function is not executed without error message
I'm trying to spawn multiple parallel (not concurrent) tasks. Every task is running a PUT operation to a custom S3 storage using AWS SDK for Rust.
The function body looks the following (the different ...
0
votes
1
answer
89
views
Get duration of a video by swift API in macOS
I'm working for weeks to get the duration of a video file. I want to use direct api calls. I know, that I can use external command line tools to get it. But I want to avoid the dependencies with these ...
1
vote
1
answer
98
views
Writing and running a stored procedure asynchronously *and* getting a return value
Suppose I have two stored procedures, foo and bar, both written using Snowflake Scripting language.
Inside foo, I want to call bar asynchronously and get a return value from bar. Is there currently a ...
0
votes
1
answer
110
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 ...
0
votes
1
answer
124
views
why am I getting "Bad state: Stream has already been listened to."?
Before asking this question, I extensively searched stackoverflow and other platforms for similar questions. However I could not find an answer to my problem.
So, basically, I am trying to use dart ...
0
votes
0
answers
63
views
WPF main function becomes MTA when made async
I have a WPF application and I'm trying to do some async stuff in the startup. I'm trying to move from:
[STAThread]
public static void Main(string[] args)
{
_app = new Application
{
...
-5
votes
1
answer
123
views
Why is arr undefined even though function returns an array? [duplicate]
const randomGIFFunc = async function(dirname) {
const dirPath = 'src/gifs/' + dirname;
fs.readdir(dirPath, (err, files) => {
if (err) {
console.log('Error reading directory: ', err );
...
0
votes
1
answer
254
views
How to run LlamaIndex ReAct agent with gpt-oss? Getting "SyntaxError: 'async for' outside async function"
I am trying to create a ReAct agent in LlamaIndex using a local gpt-oss-20b model.
I have successfully loaded my local model using HuggingFaceLLM from llama_index.llms.huggingface and it seems to be ...
0
votes
0
answers
108
views
Riverpod StateNotifier works on hot restart, but not on fresh app start
I'm building a Flutter app using Riverpod for state management. I have a SplashScreen that checks for both network connectivity and user authentication status. The SplashScreen should display ...
2
votes
1
answer
89
views
Fetch data concurrently within for loop using asnycio
I would like to optimize my current function called process_coordinates.
import asyncio
from aiohttp import ClientSession
from tqdm.asyncio import tqdm
import pandas as pd
from streetlevel import ...
0
votes
1
answer
53
views
How to show modal inside a async submit function of parent modal and wait for result
I have to paste an additional user confirmation modal box after user press Ok button in a previous message box. How to do it?
What I have as source:
export function CancelReleaseModal(props: ...
1
vote
1
answer
154
views
Unexpected thread blocking during spawned tokio file read
I'm experiencing unexpected behaviour during a file read using tokio's async I/O API.
I've optimized file reading in the following manner: Any time I read data I
await a pending join handle that ...
1
vote
1
answer
108
views
How to call an async closure multiple times [duplicate]
I am trying to get the following simple apply function to compile (simlified for example):
struct Context(i32);
pub async fn apply<F, Fut>(ctx: &mut Context, f: F)
where
F: Fn(&mut ...