Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
51 views

Memory cache using ConcurrentDictionary [on hold]

Based on internet samples I've tried to create a simple cache mechanism using ConcurrentDictionary. Assumptions: it has to work in sync/async mode it has to be ...
1
vote
0answers
18 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)...
2
votes
1answer
35 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 ...
-1
votes
0answers
15 views

How to separate sync and async methods in C# type? [migrated]

Lets say I design a generic read only repository IReadOnlyRepository. ...
1
vote
0answers
27 views

Wrap location API in coroutines

In my app I need to query location and scan wifi periodically. To conserve power I need to change the rate dynamically, depending on the distance to the target. Also I want to wait for both ...
1
vote
0answers
22 views
4
votes
2answers
61 views

Initializing multiple variables with different types using parallel calls

Consider the pattern below, where multiple async calls are made in parallel: ...
3
votes
1answer
134 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 ...
3
votes
0answers
30 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). ...
3
votes
1answer
74 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 ...
3
votes
0answers
46 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. ...
1
vote
2answers
38 views
1
vote
0answers
37 views

Python3.x Download(async) + Process(bs4) + Save(EPUB)

I had a simple webscraper with Beautiful Soup 4 which downloaded novel chapters from a website and converted them to an EPUB file. It was straight and simple imperative programming. Then I thought, ...
2
votes
0answers
137 views

Python (Sanic) Routing

I am new to Python and 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 - ...
4
votes
0answers
175 views

Custom TaskScheduler: Limited concurrency level

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 scheduler for tasks since the game is ...
2
votes
1answer
98 views

Retry Class in Java

I have the following Java code used to retry a certain actions/methods ...
3
votes
0answers
264 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 ...
0
votes
0answers
18 views

Processing object writes to external datastore in parallel using ForkJoinPool and list streams

I have the following code. I wanted to see if you thought this was a good way to go about processing an array of objects in parallel using a ForkJoinPool and array streams. This is just a sample, in ...
-1
votes
1answer
27 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 ...
4
votes
0answers
292 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 ...
0
votes
0answers
51 views

Await a list of API updates asynchronously

I have an application that fetches a list of products from an API and sends it to another. The second API call is slower than the first so I want it to start before all the items have been fetched. ...
6
votes
2answers
340 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 ...
4
votes
1answer
191 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 ...
4
votes
1answer
70 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 ...
1
vote
2answers
317 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 ...
2
votes
0answers
28 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 ...
1
vote
1answer
184 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 ...
5
votes
1answer
873 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 ...
0
votes
1answer
98 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? ...
3
votes
0answers
28 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 ...
2
votes
0answers
44 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: ...
3
votes
0answers
31 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 ...
3
votes
1answer
86 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: ...
6
votes
0answers
951 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 ...
0
votes
0answers
466 views

Uploading files asynchronously in Swift using Alamofire

I recently began a tutorial to familiarize myself with uploading content to RestAPIs via Alamofire. I've a habit during tutorials to try and clean up the code as I go along to better drill in what the ...
5
votes
1answer
124 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 ...
0
votes
1answer
31 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 ...
4
votes
1answer
86 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 ...
3
votes
3answers
351 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 ...
10
votes
1answer
96 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 ...
4
votes
1answer
265 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 ...
0
votes
0answers
166 views

CursorLoader in Fragment

I'm not sure how to properly implement a simple CursorLoader that loads data directly from a SQLite database and displays it in a ...
3
votes
0answers
259 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 ...
4
votes
1answer
124 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 ...
6
votes
2answers
216 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. ...
3
votes
1answer
184 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 ...
1
vote
1answer
57 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 ...
2
votes
1answer
138 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. ...
2
votes
1answer
838 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 ...
5
votes
2answers
349 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 ...