Stack Exchange Network

Stack Exchange network consists of 175 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.

-2
votes
0answers
46 views

c++ linux multithreaded epoll tcp server

I want to use a tcp server to receive and send some data from and to my clients so I started to make this simple server. It's targeted for Linux because I currently only buy vps Linux due its low ...
1
vote
1answer
50 views

Parallel FTP client

I was given the task to download files for a FTP server. The download should be fairly fast. 15 parallel connections can be used. I have used FluentFTP as the ...
0
votes
0answers
53 views

Asynchronous wrapper for database connection

I'm using a database that has a library for access to it. Connection is done synchronously, it's blocking and I do not have a way to abort it. To connect, I have to write: ...
-1
votes
1answer
53 views

C# Handling Task Cancellations/Timeouts and Exceptions [closed]

I am very new to Tasks and therefore new to handling task cancellations and task exceptions. I wrote this method that gets a List which is then used to populate an ObsservableCollection shown in a ...
1
vote
0answers
25 views

Asynchronous retrieval of WebExtension browser history visits

I'm writing a small class that wraps the existing functionality of browser.history.search in Firefox's WebExtensions API. The current API only directly searches for ...
1
vote
0answers
52 views

C# Async/Await networking server

I made a simple async networking server and I'd like to get some input on the code, whether things can be done better and whether the code is stable (able to hold more than 1000 connections without ...
1
vote
0answers
59 views

Async SelectMany implementation

Async SelectMany takes an enumeration (length unknown) of tasks, each of which returns another enumeration (length unknown and likely different from one another), and returns results from the second ...
2
votes
1answer
44 views

Upload a file asynchronously

I need your opinion about my practice. I want to improve it. The requirements are the following: RESTFUL + OWIN (SelfHosted) Endpoint - Upload a file asynchronously Make a request to the endpoint ...
0
votes
0answers
55 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#...
1
vote
0answers
58 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 ...
1
vote
1answer
51 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 ...
1
vote
0answers
22 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
48 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
vote
0answers
74 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
26 views
4
votes
2answers
81 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
146 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
36 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
78 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
69 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
39 views
1
vote
0answers
39 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
149 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
250 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
127 views

Retry Class in Java

I have the following Java code used to retry a certain actions/methods ...
3
votes
0answers
470 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
20 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
338 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 ...
6
votes
2answers
520 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
280 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
77 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
615 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
35 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
239 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
1k 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
119 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
33 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
56 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
32 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
94 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
1k 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 ...
-1
votes
0answers
647 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
132 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
33 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
87 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
425 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
97 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
359 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
191 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 ...