Questions tagged [asynchronous]

Asynchronous programming is simply allowing some portions of code to be executed on separate threads. It makes your applications perform better, be more responsive, and use the resources of the system they are running on to the fullest extent.

Filter by
Sorted by
Tagged with
4
votes
1answer
43 views

Async streaming of Reddit posts

roux is a Rust library that wraps the Reddit API. Neither Reddit nor roux provides a stream-like interface for obtaining the ...
0
votes
0answers
35 views

Are nested calls to `asyncio.gather()` dangerous?

I wrote this ~100 line script recently, where I tried out Python's asyncio library. When it comes to asynchronous programming in Python, I just have 2 days of ...
1
vote
0answers
52 views

Read Data from a serial port and write to influxdb

I have a energy meter which sends the kWh count periodically every few seconds via a serial port. To store this data I write the counter value and the calculated average power of the last 10s in a ...
0
votes
0answers
37 views

Multiple async wait

I need a review and best practice approach to do something like that: ...
5
votes
1answer
86 views

Async download of files

The following code is an async beginner exploration into asynchronous file downloads, to try and improve the download time of files from a specific website. Tasks: The tasks are as follows: Visit ...
2
votes
0answers
118 views

Fixed-width non-FIFO DispatchQueue

I have implemented a custom concurrent queue on top of GCD which offers two additional pieces of functionality: Limit the maximum number of concurrently executing tasks. Give manual control over ...
0
votes
0answers
56 views

Idea for writing asynchronous data processing chains easier (similar to `ReactiveX`) and its implementation

I'm writing my own library, that is for asynchronous network communication. and then, wanna write my own HTTP proxy server for load-balancing connections to backend servers with it. when I'm using <...
0
votes
1answer
77 views

Using asyncio and aiohttp in classes

To better familiarize with async requests I wrote a very simple scraper that relies on aiohttp to retrieve some basic information from the product page (product ...
1
vote
1answer
48 views

Render multiple SSRS reports in parallel

This service takes in a report request object that can contain multiple reports that need to be rendered. This code works but I'm not sure if I've implemented anything wrong. Note the ...
0
votes
0answers
70 views

Asynchronous web scraping

This is my solution to a "vacancy test" task. I'm not sure at all if I have correctly implemented the task, but here is my solution. Goals of code: Parse rows of table from a URL and ...
0
votes
0answers
62 views

Fastapi with Aiohttp not providing expected results

I am new to asynchronous programming in python. Below are two scripts(which perform the same operation) one in Fastapi + aiohttp while other is basic Flask + requests library: ...
3
votes
2answers
129 views

Multithreaded logger

I made a multithreaded logger years ago when I was still a total newbie. It "worked" (when it didn't deadlock). Now that I'm slightly less newbie I'd like to get some criticism on this new ...
0
votes
0answers
108 views

Asynchronously Iterable Queue Implementation for JavaScript

While studying Deno which is a kind of Node with everything normalized to modern JS and TS, I quickly met the; ...
1
vote
1answer
57 views

C# asynchronous tasks training (turn-based simulation)

I know embarassingly little about asynchronous programming in C#, so decided to start catching up. It would help me a lot if anyone checked this basic example I've created. Assumption: we're creating ...
2
votes
0answers
56 views

CompletableFuture in Java, code that gets responses from different websites using HttpClient in Java. What can I do better?

I have a static list of Strings (website urls), I am trying to connect to them and get responses, in syncRequests method, I am using HttpClient in synchronous manner, in asyncRequests method, I am ...
1
vote
0answers
25 views

Stoppable asyncio thread class

A threading.Thread subclass intended for running an asyncio loop that has the ability to be stopped gracefully from another ...
1
vote
0answers
48 views

What is the best way to call two async functions, one after another in spring?

Very new to spring and spring boot here... What would be the best practice for calling two async functions one after another? If I have three functions like this : ...
0
votes
0answers
200 views

Angular Typescript Async queue service

i've implemented a waiter service in Angular for syncronice multiple calls to one async function and i want to know if there exists a simplier way of atchiving the same result or if it's over ...
3
votes
1answer
61 views

Starting with asynchronous JS and promises

I've learn to code almost alone, so I really need some ideas/advice, as it started to get really difficult to advance. Because this is mostly server side, I can't provide a running snippet, but yet it'...
3
votes
1answer
909 views

Alternative class to imitate AsyncTask class (deprecated) with Thread and Handler classes

As the title says, I have created an alternative class to imitate AsyncTask class (deprecated) with Thread and Handler classes but i feel uncomfortable to use it.(the app works fine with my class) Can ...
1
vote
0answers
59 views

vuejs: best practices with vuex when you call multiple actions

I am working on a project in which I am using vue js 2 and electron , to manage the state I use vuex , I have at least 20 actions to call ...
3
votes
2answers
169 views

Send multiple REST requests at the same time. (node)

Below is a (very) simplified version of a function I made that creates multiple REST requests to gather needed information. Things to note: One of the REST calls is dependent upon the output of ...
5
votes
1answer
71 views
2
votes
1answer
334 views

Async tcp socket client: send multiple requests with one connection

I'm new to socket programming and c++. I have a the following method that sends an array to server and receives sum of the array, I tried to make it async. ...
3
votes
1answer
57 views

Node.js package that retrieves data from an API, formats it and sends it out via email to a distribution list

I've created a Node.js package that retrieves data from Icinga (a monitoring platform), formats it and passes it off to a class that generates some HTML and then sends it all out as an email. The ...
2
votes
1answer
78 views

A method that calls multiple async tasks with error handling, done the right way?

I've got a method, CheckForValue(), that uses named pipes to send a message to another process running locally, and then receive a message from that process, ...
2
votes
0answers
44 views

design to send multiple type http request

I have to send multiple HTTP requests where their payload will be different, type will be different, headers will be different, URL will be different etc. The code I have right now is ...
-1
votes
1answer
29 views

Am I using the same Typescript variable? [closed]

I am passing a in as a parameter and want to return b. This works, however I feel like it is wrong because I shouldn't have to ...
2
votes
2answers
119 views

Adding some wait time between API requests to avoid overloading the server

In Shopify a product can belong to a collection. I have written a method which accepts an organisation. It would then get a list of collections that this organisation has from Shopify. Finally, it has ...
7
votes
1answer
131 views

VBA-Sync code feedback

I was hoping to get some input on a class module I'm designing to abstract away the boilerplate of utilizing asynchronous queries in VBA. cQueryable supports both synchronous and asynchronous queries. ...
5
votes
1answer
397 views

Nodejs async with express server

I use the following code which works as expected. The code uses open ID connect to login user. Because I'm pretty new to node and express, it will be great if I can ...
5
votes
1answer
83 views

Synchronous logging of asynchronous retrieved folder info

I started learning functional programming with JavaScript and I have the basic idea of Functors, container types and etc. I was trying to experiment with arrays but I don't know how to solve the ...
2
votes
0answers
66 views

I'm just starting out with tasks. I need to know if there's a better way to do TAP for socket handling (serving a request)

I've got this quick and dirty little console app in C# to serve an HTTP/HTML page. ...
3
votes
0answers
40 views

Email sender worker-pool skeleton in go

How to refactor this go code to make it more easy to understand and to maintain? It is email sender worker-pool skeleton. To understand the working-pool logic I coded it without real email client and ...
3
votes
1answer
56 views

NodeJS executing multiple database queries using async library

I have a use case where I need to run multiple tasks in series. Each task is required to perform some database operations. In my code step_1, ...
2
votes
1answer
422 views

Parse and clean log files

I have the code below, which works successfully, and is used to parse, clean log files (very large in size) and output into smaller sized files. This would take about 12-14 mins to process 1 GB worth ...
1
vote
0answers
119 views

Sending emails asynchronously

In a part of our system a lot (I'm not sure how many, probably a couple thousand) of emails are being sent to the users at a specific time of the month. It seems this kills the server. So I was asked ...
3
votes
1answer
40 views

User Access Authorization for Web Resources

Im refactoring a large internal legacy application and part of the stuff I want to get rid is the widespread code repetition. I'm starting with the way the website checks if a User can access a ...
4
votes
0answers
98 views

Chat using async Python and sockets

I am trying out websockets using the python async framework aiohttp. Basically I have created a game which will include multiple ...
3
votes
1answer
172 views

A thread-safe typed Promise implementation in Java for Android

Introduction I've created a typed Promise implementation in Java for Android, borrowing ideas from this article for a JavaScript implementation, by Forbes Lindesay. To allow for "asynchronicity", my ...
2
votes
2answers
54 views

Python 3.6+ Conventions for fetching paginated data

I find myself often encountering a use case where I need to fetch paginated data, where I need all of the data. Currently I use something similar to below to handle these cases: ...
4
votes
1answer
389 views

Wrapping an asynchronous generator in Python

Since Python 3.6 and PEP 525 one can use asynchronous generator: ...
3
votes
2answers
2k views

Async file copy/move

My effort to write async methods for copy/move a file in C# ...
1
vote
0answers
49 views

Awaiting the completion of a server request

I faced the following problem. I have a Server object server which exposes TriggerStateChangeAsync() which return an ...
0
votes
1answer
47 views

Best approach on handling function that returns either a promise or just synchronous code [closed]

I wrote some code and I'm trying to get some feedback on it. I'll try to summerize the essential only. I have a function that based on a condition returns a promise or something else: ...
1
vote
0answers
209 views

create vscode tree item extesion

I use the following code to add tree item to vscode extension, Im getting the data and build the tree according to the entries I got, the code works. As I new to typescript I appreciate your feedback'...
2
votes
0answers
459 views

Asynchronous Web Crawler with Pyppeteer - Python

This weekend I've been working on a small asynchronous web crawler built on top of asyncio. The webpages that I'm crawling from have Javascript that needs to be executed in order for me to grab the ...
2
votes
1answer
93 views

Asynchronous TCP network server with a packet system

So I'm writing a game emulator and would like some advice after finishing the networking. It is designed to accept multiple connections, and process messages from all of them. Here is just a brief ...
3
votes
0answers
77 views

HTTP download function in Rust (async/await)

Why am I fighting the compiler? - Wrote this, which works, but I feel like I'm breaking every rule in the book: ...
10
votes
1answer
130 views

Wordcloud from all answers of a user here on CR

Since I haven't really used Python's new async features yet, I took some older code of mine, which took all of my answers here on Code Review and generated a word cloud from them, and updated it to ...

1
2 3 4 5
11