We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0
votes
1answer
38 views

Mixing Async and Sync in same HTTP request ASP.NET Core C#

Is it bad practice to mix async and sync call in same asp.net core api call? For example in following code Method CropBlackBroderOfAnImageAsync is an Async ...
3
votes
2answers
74 views

Cleaner Way to Structure Asynchronous Code

The purpose of the code is to allow the user to select directories that will be crawled recursively in order to find particular files or file types to analyze en masse. The thing to bear in mind is ...
3
votes
0answers
59 views

Python AsyncIO pipeline

I wrote a small snippet to implement asyncio Pipeline - object that connects together Layers, and lets them create and pass ...
2
votes
0answers
49 views

Concurrent execution and coordination of C# tasks

I have a class, 'TaskCoordinator' which has 'BaseTask's applied to it. The BaseTasks have OnStarted, OnFinished and OnCancelled events which are triggered to notify the calling class of their events....
2
votes
0answers
24 views

Synchronous use of Mongo-Scala Driver

The Mongo-Scala Driver (v2.6) currently only supports asynchronous operations, although my use cases often seem to lend themselves well to synchronous reads. This may be to block downstream code ...
2
votes
0answers
29 views

Seekable HTTP response stream wrapper

I created this wrapper to use together with HttpClient streams and ZipArchive. ZipArchive ...
1
vote
0answers
36 views

Node.js async task queue implementation

Here is an async task queue implementation. The idea is to reuse node.js standard library as much as possible. ...
9
votes
1answer
189 views

Operation cancellation

Brevity is for kings as it requires context and context is for kings. Me. GitHub and NuGet How many times you have been writing something like this passing those tedious logger/token parameters? <...
3
votes
0answers
40 views

Data encryption / decryption on Node.js

I've implemented my first data encryption / decryption methods on Node.js. Although it might look similar to hundreds of sample implementations available online, I'm curious to get a feedback. I'm ...
3
votes
1answer
53 views

Chain of CompletableFutures in Java

I am new to this CompletableFuture function in Java. I have the following code below that works fine but looks quite messy IMHO. ...
6
votes
2answers
248 views

Action queue manager to perform action in a FIFO fashion

Recently, I needed a class that could execute code in a FIFO fashion in order to update parts of a WinForms or WPF UI which did not block the UI Thread and left the UI responsive to any interaction ...
3
votes
3answers
100 views

BindableBase with a throttle

I have project where I'm using BindableBase for my INotifyPropertyChanged implementation. Some of my objects however are ...
1
vote
0answers
18 views

Web App Starts a long, many staged procedure and gets informed by server side events of progress until completion

For simplicity, I have omitted the SubProcedure class which has an execute function, and returns Progress when done, for the real code I simply iterate over these sub procedures and insert the ...
2
votes
1answer
35 views

Python task runner with asyncio

I'm trying to a write super simple task runner with asyncio. Basically, my goal is to run 100 requests to google as tasks, whilst also being be able to handle tasks being added at a later time. <...
2
votes
1answer
41 views

Blocking requests within Express

Is this the correct way to block requests in Express? app.js ...
2
votes
0answers
43 views

Implementing an efficient async FileSystem class based on libuv in C++

I currently am working on a game engine written in C++ with libuv backed for io system calls. I have a FileSystem class that just 'works'. I am allow to read files without blocking but the current ...
6
votes
2answers
180 views

Asynchronous IBAN API with validation

I am working on an iban api which is about saving the iban of some members after (iban validation) in a database. The code is split between Domain (entities, behaviour for iban validation), Database ...
3
votes
0answers
60 views

Example Multiple Async Await Calls Javascript

I need to make an unknown number of api calls, up to 5 max probably. But most samples I've seen show only a couple of async calls so are effectively hard coded to the number of calls being made. This ...
13
votes
2answers
1k views

Asynchronous Circular Buffer in C#

Preamble I want to be able to test methods which communicate over a simple exclusively asynchronous two-way stream-like interface which may underneath use any of a number of communication methods (e....
1
vote
0answers
59 views

C++ - simulating Windows' IO completion ports in Linux

This is a simple implementation of IO completion ports in user mode for Linux. In Windows IO completion ports work like this: There is a global queue for issuing IO requests. Some worker kernel ...
1
vote
1answer
32 views

Optimizing calls for reauthentication by caching tokens and cookies

I am currently developing a REST service in ASP.NET Core 2.2 that acts as a wrapper upon a REST API provided by a reporting solution. The reporting systems REST API authenticates the user based on a ...
3
votes
1answer
76 views

An asynchronous logger

I've written a simple asynchronous logger (playground): ...
3
votes
0answers
92 views

Async in Railway Oriented Programming in F#

In F# the Railway Oriented Programming pattern can be implemented synchronously using the Result<'t,'terr> type as result value for functions, so they can be ...
4
votes
0answers
61 views

Asynchronous Stripe API and aiohttp parameters formatting

I'm testing the Stripe payment API. I couldn't find a Python wrapper that provides asynchronous requests so I'm writing one. My first goal was to implement the async equivalent of ...
4
votes
0answers
53 views

Implementation of a time lock with Python's asyncio

I have no idea if this kind of lock is called time lock, but I need something for the following scenario: I'm making a lot of concurrent requests with aiohttp, and ...
0
votes
2answers
103 views

C# Tasks for Asynchronous Operations

I currently use the following code to asynchronously create a cimsession to a remote host, query the remote host, return multiple values and finally updated some textboxes on my WPF window. Just ...
0
votes
0answers
29 views

Making Oauth request asynchronously, with retry if token has expired

I'm struggling with asynchronous code. Does anyone have suggestions of a better way to do the following? What I'm doing: hitting an API (google's, actually), with a call that might get a 401 if the ...
4
votes
1answer
95 views

Wrap a callback method in an awaitable method

I'm using a .NET library which uses a pre-async/await type of asynchronicity. That is, it provides asynchronous (non-awaitable) method with a callback parameter. I'm trying to write awaitable ...
1
vote
0answers
57 views

Chaining asynchronous calls to update UI [closed]

In an app the UI is updated from different threads. To queue this, I have created a utility class ...
2
votes
1answer
95 views

Performing an action which may return other actions to be performed, concurrently

I have a program which, at its core, involves repeatedly performing an action on some value, and based on that action also returning a list of new values to perform that action on. The pure version of ...
4
votes
2answers
74 views

Static site generator using JavaScript Promises

I have created a small static site generator (for learning purposes) in Javascript ES6, using Promises, but I am not certain of how to use them well. The code below works fine, but I wonder if i can't ...
1
vote
0answers
50 views

C# asynchronous notification vector v2

As a result of my previous post, I have implemented / refactored my code and have started making successful use of my class. However I have come across a couple of new questions: The observer must ...
1
vote
0answers
42 views

multiple AJAX requests and multiple SetTimeout animations

multiple AJAX requests and multiple SetTimeout animations I wrote a piece of code that included multiple AJAX requests and multiple SetTimeout animations. I want the code to perform better, ...
3
votes
0answers
36 views

Node/Express authenticate Google email address

Trying to set up express server that will authenticate a user's Google email before proceeding. The code below works, but is there any way to make it more elegant? The whole ...
1
vote
0answers
84 views

Putting a Queue Between HTTP Request/Response

We currently have two legacy systems: the Consumer and the Worker. These systems are massively complex in ways that are not important to this review, but it is enough to say that a large-scale re-...
4
votes
0answers
75 views

Python server that performs sentiment analysis on Twitter data

I have a fully working Python server that utilizes Tornado, asyncio, websockets and tweepy(Twitter's Streaming api). The main point of this server is to receive a query from the user, call upon tweepy ...
2
votes
0answers
44 views

REST API request automation [closed]

I created a class to automate some requests for an API. Can I improve this code in any way? The code itself is very simple and easy to understand. ...
6
votes
1answer
90 views

C# asynchronous notification vector

The purpose of this class is to efficiently notify another thread when data is available with minimal blocking to access/pass the data. The data reader/producer thread processes data in bulk which ...
2
votes
0answers
213 views

Let Them Eat Lists, Eventually (Asynchronous Generic List Consumption with Spring and CompletableFuture)

I want to reduce some repeated code in my Java 1.8/Spring Boot application, and to that end I tried to make a reuseable asynchronous utility module. In essence its an async List.forEach that takes a ...
4
votes
2answers
409 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 ...
1
vote
1answer
71 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
119 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
30 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 ...
2
votes
1answer
87 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
399 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
53 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 ...
1
vote
0answers
68 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
391 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
53 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
45 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)...