New answers tagged asynchronous
0 votes
In Flutter I have a number of same async function running whoose result can come at any time. But I want to process the results sequentially
It is not that difficult. Below is a simple example. The longer the text, the longer it takes to process. Playback occurs in the order the text is received. Text is received in alphabetical order, but ...
Best practices
0 votes
0 replies
0 views
How to adhere to abstraction and asynchrony
The await is redundant; nothing happens until one starts "retrieving" from the enumerable. And I wouldn't "to list" ... which is only needed if you intend to "index into" ...
0 votes
Await future for a specific time
Say, we make a http post request and await for its response before we close the http request, but, we wait for only 3 secs, else we close the request. It is not that hard to interrupt your own ...
Best practices
0 votes
0 replies
0 views
How to adhere to abstraction and asynchrony
I think Task<IEnumerable<Patient>> is a controversal combination and should be avoid. If we have a single query with small data fetch then it can be Task<IReadOnlyList<Patient>&...
Best practices
0 votes
0 replies
0 views
How to adhere to abstraction and asynchrony
What is your objective when introducing an abstraction around EF? If it is to facilitate unit testing, or to standardize an interface with commonly enforced rules, then I recommend having the ...
Best practices
0 votes
0 replies
0 views
How to adhere to abstraction and asynchrony
TBH for quite some time I avoid abstracting over collections in the repository - i.e. I return arrays/List's. In my experience using IEnumerable in repositories (at least in ) is a very leaky ...
Best practices
0 votes
0 replies
0 views
How to adhere to abstraction and asynchrony
The interface must cater to the most restrictive implementation. If even one of your implementations requires async, your abstraction is now an asynchronous one. You cannot "hide" asynchrony ...
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
Simple answer, do not use Kafka and Spark, use queue like ActiveMQ, Rust and DuckDB/Polars.
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
my ultimate goal is to capture these LLM response and store in Hive, in this situation microbatch process become sync setup.
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
I've just updated my answer with a provider-agnostic Python snippet and more architectural details. Take a look
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
Currently, we are using a self-hosted vLLM setup, but we may switch to OpenAI or Anthropic in the future depending on the use case. I agree with your point, but my goal is to design the system in a ...
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
As of now we are using self hosted vLLM , but can change it to OpenAI or Anthropic based on the use case in future.
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
As of now we are using self hosted vLLM , but can change it to OpenAI/Anthropic based on the use case in future.
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
As of now we are using self hosted vLLM , but can change it to OpenAI/Anthropic based on the use case in future.
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
As of now we are using self hosted vLLM , but can change it to OpenAI/Anthropic based on the use case
Advice
0 votes
0 replies
0 views
How to perform asynchronous LLM inference on Kafka streams using Apache Spark, and handle high-throughput RAG ingestion?
Great question. Are you using a managed LLM service (like OpenAI/Anthropic) or self-hosted vLLM? The backpressure strategy differs significantly based on the API's rate limits. Architectural Patterns ...
Advice
0 votes
0 replies
0 views
Multithreading Programs
"Async...doesn't refer to threads at all..." The "async" model of concurrent computing can be described without reference to the "threads" model, but many practical ...
0 votes
How to make a delayed future cancelable in Dart?
It can be done like this. And, of course, this is just an example. It can be simplified (by omitting the youStillWantThisToExecute variable). Task.sleep() == Future.delayed() import 'dart:async'; ...
0 votes
Why does Future.timeout not work in dart?
This can be done like this (for example, using Isolate to perform short calculations). While a separate isolate is doing calculations, the current isolate is idle (or performing other tasks). import '...
0 votes
Dart timeout on await Future
I need it because in some networking operation, the connection is sometimes producing silent error. These silent errors are documented for the http package in the close() method: Resources are always ...
0 votes
Flutter multiple async methods for parrallel execution
If you are familiar with the basics of asynchronous programming, then you can do anything the way what you need. For example, like this. import 'dart:async'; import 'dart:math'; import 'package:...
0 votes
Pause an async function until a condition is met in dart
If you need a truly asynchronous solution (based on your own queue, not an internal one), working in a concurrent environment, then you can use an asynchronous monitor (lock + condition variable). ...
5 votes
Accepted
Why does python 3.13.8 raise an IndentationError when running in asyncio mode on the terminal
I am unable to replicate the error under normal conditions: % uv run -p 3.13.0 python3 -m asyncio # asyncio REPL 3.13.0 (main, Oct 16 2024, 08:05:40) [Clang 18.1.8 ] on darwin # Use "await" ...
Advice
1 vote
0 replies
0 views
ESP Watchdog vs AsyncWebServer with expensive handler
AsynWebServer for ESP32 is built on top of AsynTCP, which is the async com callback that executed in the context of tcp network callbacks. Code executing within these callbacks should be fast. While ...
0 votes
NG 21 + Vitest + Non-standalone component with async pipe
It's an issue with Angular AOT compilation, non standalone component dependencies are not properly handle during compilation, disable AOT and use JIT instead (AOT is the default behavior with vitest): ...
0 votes
Flutter: Prevent deadlocks in a task queue when tasks enqueue other tasks
Maybe this code can handle it? It simply blocks the execution of the next (in the queue) code until current code releases the lock. import 'dart:async'; import 'package:multitasking/synchronization/...
Advice
0 votes
0 replies
0 views
Multithreading Programs
Async/await uses cooperative suspension points within a single thread, while OS threads are scheduled pre-emptively by the kernel. Async does not disable pre-emption; it simply controls where ...
Advice
0 votes
0 replies
0 views
Multithreading Programs
May be one day async IO will be implemented as a language feature, but not yet. A quick search for async file IO on Linux revealed: 1. POSIX AIO - runs thread pools on your behalf - poor performance 2....
Advice
0 votes
0 replies
0 views
Multithreading Programs
All forms of parallelism are still relevant, since each has its own strengths and weaknesses.
Advice
2 votes
0 replies
0 views
Multithreading Programs
Async in general doesn't refer to threads at all (e.g. async I/O). And when it does (e.g. the async and await keywords in multiple languages), it usually refers co-operative multithreading, which is ...
Advice
1 vote
0 replies
0 views
Multithreading Programs
“Async” operations are just a more modern and hopefully easier method to control multiple threads. Under the hood it is all multithreading.
-1 votes
Difference between calling an async method and Task.Run an async method
you should not call method with -Async postfix with Task.Run()!! - thus you create async method twice in ThreadPool, that is unnecessary. - e.g. in var users = await _dbContext.Users.ToListAsync(); ...
0 votes
How to limit the maximum number of parallel tasks in C#
Use Polly Rate Limiter, with Concurrency Limiter configuration you can create separate thread pools per use case you can add new tasks into the pool at runtime, during execution, not just at pool ...
0 votes
How to limit the amount of concurrent async I/O operations?
Use Polly Rate Limiter, with Concurrency Limiter configuration you can create separate thread pools per use case you can add new tasks into the pool at runtime, during execution, not just at pool ...
0 votes
How to implement an async task queue with multiple concurrent workers (async) in dart
A counting semaphore is a synchronization primitive that maintains a counter that represents the number of available permits. Example with a limit of no more than 3 simultaneously executed operations. ...
Top 50 recent answers are included
Related Tags
asynchronous × 51969javascript × 14252
c# × 11306
node.js × 7169
async-await × 7105
multithreading × 3771
python × 3483
java × 3161
promise × 2846
.net × 2546
jquery × 1863
reactjs × 1705
android × 1699
callback × 1473
ajax × 1433
ios × 1359
task × 1334
c++ × 1208
swift × 1182
angular × 1169
python-asyncio × 1149
asp.net × 1063
typescript × 915
task-parallel-library × 874
angularjs × 852