Category "asynchronous"

How do I use a channel receiver inside a nested closure?

I want to share some data between an async function with another async function running on a separate thread. In this case it's a cronjob. This is the solution

How Kotlin's coroutine is cancelled under the hood?

Suppose we have a CoroutineScope and we launched several coroutines from it via launch. Then we do CoroutineScope.cancel(). And then we need to wait until cance

How to return the response from an asynchronous call

I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to return the value from the callback, as

Await not returning in SpecFlow async test step

I'm having trouble with some async SpecFlow unit tests where an await is never returning. I think that it is to do with the SpecFlow SynchronizationContext, but

Async/Await function failing

I'm trying to build a nodeJS script that pulls records from an Airtable base, bumps a UPC list up against the [UPC Item DB API][1], writes the product descripti

Django celery and heroku

I have configured celery to be deployed in heroku, all Is working well, in fact in my logs at heroku celery is ready to handle the taks. Unfortunately celery do

Problem with CancelIoEx function on some platforms

I work with usb device and use async functions of usbdk driver for I/O operations. I have a problem with canceling of operations on some win platforms. Im using

Rust - return a future in a closure

I am trying to add a return type of a future in a closure. But the compiler is telling me that `impl Trait` only allowed in function and inherent method return

Exception: Context is null, please call ToastContext.init(context) first

The issue is seen on the Toast.dart and Armodel.dart. if possible please suggest me how do i implement OCR as i followed up the codes from Pubdev but still when

How to do two tasks at the same time in asyncio or multithreading?

I'm trying to achieve a task that requires real-time interaction, for example: A message (response) is received - it needs to be acted on at the same time. I tr

How to add CancellationToken on Unity Web request?

I wrote the following code that successfully downloads a photo from the link. But I want to set a cancellationToken for the request that can be activated by pre

How to do multiple aio_writes to file

When doing multiple aio_writes to file is it necessary to wait (e.g. aio_suspend or other) before starting the next one? From the documentation it says that wri

The publishing code below is stalling on time.sleep() how can i change this behaviour + what would be a good way to implement a thread safe cach

For refreshing skills for a new job i have been trying to implement a very simple price publisher + client + mtm_cache. In the code below in publishing.py the c

How to return the response from an asynchronous call

I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I am trying to return the value from the callback, as

Is the async keyword required to create asynchronous functionality? Did this functionality change in the recent past?

I'm attempting to show that it is possible for my team to add asynchronous functionality to a currently "fully-syncrhonous" program. Are there any reasons, such

Best way to handle 2 websocket connections in the same time

i am handling data from 2 websocket servers and i would like to know whats the fastest way to handle both connections in the same time given that the 1st connec

How to run background task in parallel (python, FastAPI)

I am currently developing an API that has several endpoints. One of them is to register data in a database, other endpoints are related to simple CRUD endpoints

Testing async methods in jest gets mock resolved values mixed up

I'm writing some jest tests to test an async method. If I run each test individually, it works! However, when I run the whole suite, they fail. The mock values

UseStore is async? How to ensure that store-data is loaded completely?

I have a serious problem with State Management in React. I am using Zustand and it works pretty well. However, when I access the store and try to output it one

Azure Functions: StatusCode cannot be set because the response has already started

I am trying to stream data from my Azure Function and all is fine but I get an error after it has executed. This is the code: [FunctionName("QueryData")] public