51,992 questions
0
votes
1
answer
70
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
87
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,
...
-3
votes
0
answers
44
views
Async Events telemetry tracing problem because of batching of events
I'm implementing Telemetry in my Spring Boot web app using OpenTelemetry instrumentation.
All is fine except when dealing with async events.
When I produce/publish, for example 100 events - all ...
Advice
0
votes
1
replies
49
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 ...
Advice
1
vote
4
replies
75
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 ...
-2
votes
2
answers
121
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
0
answers
88
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, ...
1
vote
0
answers
94
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 ...
0
votes
0
answers
51
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__(...
2
votes
1
answer
59
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 ...
-3
votes
1
answer
99
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
115
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:
//...
2
votes
2
answers
88
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
83
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 ...
0
votes
1
answer
107
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
0
answers
57
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
{
...
0
votes
1
answer
231
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 ...
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 ...
1
vote
1
answer
130
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 ...
0
votes
0
answers
92
views
How to read Boolean value from Stream as a TextReader asynchronously?
I have this code which works but is a complete mess. Is there any more efficient way to read a Boolean value from a stream asynchronously that doesn't involve checking each character in such a manual ...
1
vote
1
answer
137
views
Blazor not showing spinner when page loads [duplicate]
I have created a Blazor application that uses
Authentication Type = User Accounts
I have added a new menu item to the account area. This new area has a spinner that is shown until the data in that ...
1
vote
0
answers
84
views
@RecordApplicationEvents (still) not working for async events
I tried to switch our application to use Async Events. Now our event publisher tests fail.
I found a few posts mentioning this https://github.com/spring-projects/spring-framework/pull/30020
So with ...
1
vote
1
answer
140
views
True Non threaded Asynchronous File IO in c++
How to verify if Boost.Asio actually uses Windows Overlapped I/O for file operations?
I'm implementing high-performance file I/O in C++ on Windows and need to confirm whether Boost.Asio truly ...
1
vote
2
answers
94
views
How can I manually trigger garbage collection from an asynchronous javascript function?
I'm calling global.gc() in some unit tests, but for some reason it only seems to have any impact when called synchronously. If I call it asynchronously, I never seem to get a cleanup callback in my ...
0
votes
0
answers
90
views
value setter for a custom select element with lazy loading
Edit ############
I had omitted the fact that this is an extension code, which seems a crucial information.
I have realized the problem is probably not caused by race of any of my functions but rather:...