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
1 vote
0 answers
92 views

Aggregate sensor readings from multiple sources

I've developed a toy example to investigate how async works in C#. Though I've learned a lot this week, I'm still unsure of the finer details, as this is my first C#...
Mike Ekim's user avatar
2 votes
0 answers
976 views

Downloading multiple urls with aiohttp Python 3

I am trying to use aiohttp library in python to download information from url. I have about 300 000 urls. They are saved in file "my_file.txt". When I get web page, I extract pairs of a question and ...
Danil Kononyhin's user avatar
1 vote
1 answer
66 views

Processing a company list in which every element is an employee list

Now, there is a company list in which an element is an employee list in every company. I calculate the salary of employees in every company with a RESTful API one by one,. This is very slow, so I join ...
Happy Boy's user avatar
  • 123
1 vote
0 answers
100 views

A syslog to Azure Log Analytics forwarder

I am using this code to forward my syslog logs (converted to json using syslog-ng) to Azure Log Analytics on an ARM board (since there is no official client for ARM)...
Nazar554's user avatar
  • 331
2 votes
1 answer
425 views

Await socket Response

I wrote this to make the "callback hell" more manageable on the part of the coder when using Socket IO, so that there wasn't really any callback hell to go with, just a simple await. This should work ...
FreezePhoenix's user avatar
4 votes
2 answers
2k views

Initializing multiple variables with different types using parallel calls

Consider the pattern below, where multiple async calls are made in parallel: ...
julealgon's user avatar
  • 224
3 votes
1 answer
400 views

Search for rows in a 2D array that contain a given sequence

I have a 2d array of m * n dimension (m and n can vary from 1 to 100000). The following snippet of code checks if the sequence exists in the row and stores the index if it exists. The time taken by ...
user avatar
3 votes
0 answers
202 views

Templatized GLib asynchronous queue

I'm working on a legacy C++ project, which is using GLib for its Main Event Loop. This has caused a lot of ugliness because it mixes C++ and C paradigms (no C++ wrapper for GLib had been used). ...
Wizard79's user avatar
  • 141
3 votes
1 answer
120 views

Monitor asynchronous tasks, tracking their running times

Scenario: I'm getting requests through a (thread-safe) queue. Each request then needs to be handled in a separate thread. There is a chance that the function (which is actually calling a Java-program ...
E.F.'s user avatar
  • 31
3 votes
0 answers
652 views

Collecting folly::Futures with an associated value

I'm trying to implement a batch API where requests are associated with an id. In the batch response, the individual success/failure responses should be associated to their corresponding request id. ...
Savior's user avatar
  • 131
1 vote
2 answers
98 views

Error handling for a simple 'fetch some data, then save the data' Node function

This is a fairly simple bit of code: ...
dwjohnston's user avatar
  • 1,326
2 votes
0 answers
261 views

Python (Sanic) Routing

I wanted to explore how I can associate routes with "controllers" with Sanic as a base. It works fine but "feels" a bit clunky but I can't put my finger on why/how. routes.py - Returning controller ...
ggdx's user avatar
  • 71
5 votes
0 answers
1k views

Custom TaskScheduler: Limited concurrency level [closed]

I'm interested in some feedback for a custom TaskScheduler implementation I wrote today for use on a game server - I wanted to be able to have a single-threaded ...
M Anderson's user avatar
2 votes
1 answer
1k views

Retry Class in Java

I have the following Java code used to retry a certain actions/methods ...
MoonKnight's user avatar
3 votes
0 answers
4k views

Await in... VBA?

Asynchronous programming is tricky enough already, and VBA doesn't make life any easier. I wanted to create some basic functionality to allow async processes to mark completion without having to ...
Greedo's user avatar
  • 2,345
0 votes
1 answer
36 views

AppTaskWorker - Running class methods at sporadic intervals

I decided to write a class to do this for me. I had a lot of methods that needed to be invoked at sporadic intervals, across multiple projects. The dictionary will eventually be class methods, I ...
Josh Hallow's user avatar
  • 1,305
6 votes
1 answer
848 views

Asyncio HTTP Request Queue

I wrote a simple sitemap.xml checker using asyncio and aiohttp. I followed the documentation demonstrating the producer/consumer pattern. However, I noticed that as the URLs scale larger, it seems to ...
user avatar
6 votes
2 answers
4k views

Async Queue implementation without locking

I wrote a quick implementation of an async queue that utilizes a backing ConcurrentQueue. It was pretty much based on an implementation given in this Stack Overflow ...
9ee1's user avatar
  • 163
4 votes
1 answer
1k views

Scraping urls asynchronous including exception handling

I'm trying to understand how to work with aiohttp and asyncio. The code below retrieves all websites in ...
RandomDude's user avatar
5 votes
1 answer
175 views

Async/Await Computation Expression

When writing asynchronous code in F#, one often needs to call methods in the .NET BCL that return Task or Task<T> rather ...
Aaron M. Eshbach's user avatar
1 vote
1 answer
5k views

Starting a process asynchronous

For executing a Process I've created an separate class which binds the possibilities together, for example reading output, start as Admin, catch Exceptions and also start all this asynchronous. Are ...
Coden's user avatar
  • 111
3 votes
0 answers
63 views

Status dispatching of my redux-thunk async action (post request)

I'm trying to dispatch to my reducers the current status of my request. So far I'm wondering how refined the status publishing of my thunk action. I feel like my code is very verbose and I wonder ...
CodingWeb's user avatar
  • 179
3 votes
1 answer
2k views

Concurrent fire and forget async task queue

I had to do a lot of IO stuff on my server running Node JS where I did not really care about the result of the operations. The list of incoming tasks could be huge, so I had to limit the number of ...
Endauriel's user avatar
  • 153
8 votes
1 answer
19k views

Async friendly Timer

I'm trying to implement a Timer that schedule an async action with the following requirements: thread safe only one action should be running at any given time (period countdown should start when the ...
None's user avatar
  • 85
0 votes
1 answer
205 views

Async Task using RxJava2 in Android

I have tried to create the async task using the RxJAVA2. The code is working fine. WHat enhancement can I do in this code? ...
Ankur_009's user avatar
  • 131
3 votes
0 answers
109 views

TextFileConvert - dos2ux and ux2dos in VB.NET

This provides text file conversion capabilities like the common Unix utilities "ux2dos" and "dos2ux". I needed the capability to perform Unix text file conversions, round trip, within a VB.NET ...
HackSlash's user avatar
  • 372
2 votes
0 answers
130 views

An asynchronous solution to send validation email [closed]

I intend to send validating message to User's email to complete a registration with the following codes: ...
Wizard's user avatar
  • 449
4 votes
0 answers
42 views

Validating a collection of proxy servers with maximum possible throughput

I am validating a collection of proxy servers and trying to achieve the maximum possible throughput. I've tested a few different methods, such as Task.WhenAll, TPL ...
JohnWick's user avatar
  • 425
3 votes
1 answer
184 views

Issue tokens concurrently with synchronization per client

I have an API application with token authorization. A token is valid for one hour. Each business client has its own instance of the API application: ...
mtkachenko's user avatar
6 votes
0 answers
4k views

Non-blocking C++ sockets [closed]

I'm trying to use sockets to create a simple client and server architecture and I'm wondering if there is any other way to create non-blocking, 'async' sockets instead using ...
bielu000's user avatar
  • 241
5 votes
1 answer
292 views

Deal with partial messages using SocketAsyncEventArgs

As you know, when dealing with SocketAsyncEventArgs, this is possible to receive partial messages and depending on the protocol used, you have to deal with it. In ...
Mathieu Paquette's user avatar
0 votes
1 answer
41 views

Accumulate ids to make a single ajax request

I have multiple places where I need to make ajax requests to fetch the items corresponding to some ids. However, I only want to make a single request by accumulating these ids and debouncing the ...
Amr Noman's user avatar
  • 109
4 votes
1 answer
124 views

Handling a single connection to a server or client

I'm writing an asynchronous TCP server and client for a game in C# and in particular getting sending right is a bit tricky because calling BeginSend() before ...
Jesper's user avatar
  • 141
5 votes
3 answers
1k views

ListBox async filtering, cancelling previous task on filter update

I'm trying to come up with a nice way of filtering a ListBox asynchronously, to keep the UI responsive. The filtering gets fired off asynchronously each time the ...
Scroog1's user avatar
  • 508
10 votes
1 answer
159 views

Simple concurrency implemented in Python

Purpose of the question: learn more about ways to implement concurrency in Python / experimenting. Context: I want to count all of the words in all of the files that match a particular pattern. The ...
Michael's user avatar
  • 285
4 votes
1 answer
2k views

PauseOrCancelTokenSource

I added this implementation of PauseToken and PauseTokenSource to my project from this MSDN blog post: Cooperatively pausing async methods Since I will usually be passing in both a PauseToken and a ...
JohnWick's user avatar
  • 425
3 votes
0 answers
658 views

Making 10000 HTTP requests as fast as possible

I need a program that needs to gather data from large list of API end points. Below is a mock-up program that attempts to make 10000 requests as fast as possible. Any suggestions on how to improve on ...
rajendra's user avatar
  • 139
4 votes
1 answer
2k views

Testing validity of Proxy servers concurrently

I am trying to test the validity of a few thousand public proxy servers quickly. To do this, I am sending web requests using each proxy to a website such as example.com, and checking that no errors ...
JohnWick's user avatar
  • 425
6 votes
2 answers
1k views

Async File Input

I recently started work on my own Async file input "library" in C++. I got it done today and I decided to put it on Code Review to see how well I actually did, and where I can still improve the code. ...
MivVG's user avatar
  • 205
4 votes
1 answer
1k views

Asynchronous file upload to disk

I have a simple webserver written in Python using aiohttp. My goal is a server that can receive many file uploads simultaneously and stream them all to disk. This ...
bcattle's user avatar
  • 143
1 vote
1 answer
70 views

Executing asynchronous functions in sequence

I implemented a function for practice that takes a collection of asynchronous functions and a callback. It executes the functions in sequence then calls the callback with the results (coming from the ...
Mark Adel's user avatar
  • 317
3 votes
1 answer
747 views

Asynchronous File System Abstraction

As a side-project, I'm trying to implement a distributed object storage. I've decided to use C++ and libuv, two technologies I had never played with, since it gave me a good reason to learn them. ...
Jazzwave06's user avatar
3 votes
1 answer
4k views

Scraping with asyncio/aiohttp and retrying the request on error

I am doing some practicing with back-connect proxies and asyncio/aiohttp. The IP changes on every request to the proxy and I am allowed up to 1500 threads. The big issue with back-connect proxies, is ...
antfuentes87's user avatar
6 votes
2 answers
1k views

Minimalist dynamic task scheduler

Dynamic execution policy did not make the cut for C++17. Submitted for your criticism, a minimalist dynamic task scheduler to use until the std::async sorts it out... I am interested not only in ...
Jive Dadson's user avatar
1 vote
2 answers
572 views

Asynchronous Queue

implemented a basic Asynchronous Queue so, that I can do await queue.push(item); const item = await queue.pop(); basically I'm trying to convert a synchronous ...
eightnoteight's user avatar
1 vote
1 answer
104 views

Asynchronous Stack

implemented a basic asynchronous stack so, that I can do. await stack.push(item); const item = await stack.pop(); basically I'm registering listeners when ever i'...
eightnoteight's user avatar
3 votes
0 answers
30 views

Testing whether pages can be fetched from two ports

I have an endpoint in my API which does a port test on 4455 and 4456 once a client GET's it. This is accomplished by requesting two web pages. The result will respond to the client with a JSON object: ...
Harvey's user avatar
  • 131
2 votes
3 answers
767 views

Fetching user details, posts, and comments using promises in ExpressJS

I'm creating an API service in NodeJS using Express (version 4) Framework. Created an MVC architecture for the same (no views, only model, and controller as this is an API). Also, there are routes. ...
Smokey's user avatar
  • 23
1 vote
1 answer
2k views

Executing multiple async methods synchronously without throwing

I have a following task: execute multiple asynchronous methods synchronously and always execute them all, even when one of them throws. Rethrow thrown exceptions if any occured only after all tasks ...
LadislavBohm's user avatar
1 vote
1 answer
78 views

Chaining three promises in Angular.JS

I have demonstrated promise chaining where promise's p1,p2,p3 has to be resolved synchronously. The code below is using angular.js 1, and here P3 is resolved then P2 and then P1. ...
Rahul Shivsharan's user avatar

1 2 3
4
5
11