Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [async-await]

This covers the asynchronous programming model supported by various programming languages, using the async and await keywords.

42 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
98 views

Single-threaded fully asynchronous server, with a SocketSelector that dispatches events

I need a fully asynchronous single-threaded server written using .Net Core. Searched for options and, surprisingly, did't find any. So I decided to write a simple prototype. Borrowed idea from python'...
6
votes
0answers
3k views

Socket application using TPL

This is an application I wrote that allows multiple TCP clients to share a single TCP connection to a remote server (hosted project, and a demo). Traffic generated by the server is forwarded to all ...
5
votes
0answers
143 views

Scheduler built with observables v2 (follow-up)

It would probably be too easy if the old Scheduler worked as intended being that simple. But an eye-openig review showed that from time to time it'll miss one ...
4
votes
0answers
1k views

Sending notifications with Django channels

I have project on Django wich use Django Channels. I use Django Channel for sending notifications to users who are subscribed to articles changes (adding/editing/deleting comments on article). So I'...
4
votes
0answers
88 views

pool of python coroutines

Task control how much coroutines are running simultaneously with ability to stop the process from inside. Use case when scraping websites you want to control how much memory program consumes and ...
4
votes
0answers
50 views

Coordination function

This function started very clean but I had to add requirements: Added a Stopwatch to only update the caller periodically. I guess that responsibility could be ...
3
votes
0answers
36 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
0answers
55 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 ...
3
votes
0answers
52 views

Communication with interactive program using ChildProcess

There is an interactive program, namely Microchip Debugger (Later called MDB), which I want to communicate with from NodeJS program. You can think about it as any console-based debugger - they all do ...
3
votes
0answers
75 views

Scheduler built with observables v3 (follow-up) - now testable

This is a 2nd follow-up to my previous one about a Scheduler built with observables. Although the last one was working correctly, it was only possible to see this ...
3
votes
0answers
367 views

TCP client reading socket asynchronously

I'm relatively new to .Net/UWP networking and have been trying to make sense of the APIs. I'd like to implement a TCP client that is capable of reading and sending messages independently (there is no ...
3
votes
0answers
359 views

Blocking Promise-driven queues with ECMAScript's async/await and generators

I implemented an AsyncQueue, whose dequeue() operation returns a Promise. The ...
3
votes
0answers
178 views

Minimal Async Web Server in Rebol 2

I'm building a rudimentary web server in Rebol 2. I'm trying in particular to understand the flow and logic behind the asynchronous aspects of the TCP scheme. As far as I can understand it, you ...
2
votes
0answers
33 views

Porting python's 'with' construct to TypeScript

Now that async generators are available in the platforms I care about, I figured I'd try porting Python's ingenious with construct to JS as a utility. My first stab ...
2
votes
0answers
72 views

Conditional AsyncLock implementation

I have a case where I match data from DB by the various filters. Until the match is updated in the DB, I don't want to accept requests for matching with the same criteria, as this could produce ...
2
votes
0answers
270 views

React widget to display, sort and search remote data

I've created a React widget that pulls data on crypto-token pairs from a remote API and makes that data sortable by headers and searchable. You can view a demo of it here. Is this a maintainable way ...
2
votes
0answers
166 views

Server app: pinging up to 500 clients asynchronyosly

TCP/IP server which controls up to 500 clients. There's a list of added computers and the server gets this list, selects computers which are not already connected and ping them using host name. ...
2
votes
0answers
724 views

Async/await Mysql wrapper

I used MySQL, but it was inconvenient so I made a wrapper. It works, but I'm unsure if there are any issues. Used node module - mysql2, bluebird sqlWarpper.js ...
2
votes
0answers
116 views

AsyncLock implementation for JS

I made an AsyncLock implementation due to a comment on Hacker News saying JavaScript was missing such a necessary idea. I honestly am not terribly familiar with Threaded programming and the concept of ...
2
votes
0answers
189 views

asyncio with live update and abort capabilities

This is my first shot at asyncio. I'm looking for any pointers you might have. Especially: Are there any race conditions? This code doesn't scale as expected. In ...
2
votes
0answers
341 views

Promise-based unit tests using Pub/Sub

I've recently been learning and adopting Promises, async/await, and unit testing for my JavaScript server project. I just finished a unit test for some pubsub code that was more convoluted than ...
2
votes
0answers
160 views

Establishing a TCP connection with async & await

I'm not really super experienced async/await and working with tasks, so I thought I'd ask for some other opinions. I'm working with code written by someone else that establishes a TCP connection. It ...
2
votes
0answers
123 views

Multithreaded download of images from a spreadsheet

I've been wanting to go async with my HTTP calls but all the methods I tried have not worked, so I resolved to implement this as a task and then improve upon it. This is what I've come up with so far....
2
votes
0answers
453 views

Implementing TAP around WMI

I'm trying to improve my skills with the Task-based Asynchronous Pattern (TAP), by writing simple task-based wrappers around some WMI methods: ...
1
vote
0answers
27 views

Passing JSON files through an API - node async

I am writing a small program which reads some JSON files, passes the content to an API, then saves the response in some more JSON files. A pretty simple task, and the code works fine, but I have been ...
1
vote
0answers
40 views

Custom hook to handles async calls with loading and error state?

I have built this hook to handle async calls. It should manage state for the loading and ...
1
vote
0answers
13 views

Functions to handle async calls and also handle loading and error status in React component

I've got the following component structure: Component hierarchy: <AdminBlogPostContainer> <AdminBlogPostPage> <BlogPostForm> ...
1
vote
0answers
26 views

DB2 monitor using idb-connector

Monitors DB2 for changes in table data. It doesn't take any actions with the data just yet, only checks to see if new data is available every 2 seconds. ...
1
vote
0answers
82 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-...
1
vote
0answers
373 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 ...
1
vote
0answers
67 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
247 views

Using up to 15 connections to synchronize files from a FTP server with local files

Task: Create a service which will synchronize files on FTP server with files on local drive. FTP server allows up to 15 concurent connections Synchronize the files as fast as possible Files on FTP ...
1
vote
0answers
67 views

Async API Function with Mongoose

I'm quite new to the language and I just started using async/await. I've written this function for an API that I'm developing. It checks what is sent by the user, specially the status that he wants to ...
1
vote
0answers
127 views

An `async..await` based way to handle the output of a child process

I've recently answered a question on Stack Overflow where the asker was wondering how to read from the standard out of a child process he was spawning inside a ...
1
vote
0answers
101 views

Creating a menu for a quiz

I've built a menu for a quiz, where everything is hard-coded apart from the categories, which I'm pulling from an API using Axios. Api.js ...
1
vote
0answers
279 views

TaskQueue implementation

To overview async tasks as "Loading configuration", "Saving configuration" and "Discarding configuration" I created a TaskQueue type. I want to be able to schedule ...
1
vote
0answers
3k views

Using async/await with Node.JS MySQL

Is this the right way to use async/await with the JavaScript MySQL client? I had to use the promise-mysql package because it wraps the function calls with Bluebird promises, so that I'm able to use ...
1
vote
0answers
896 views

Handling Tasks to read HttpRequestMessage in an Azure Function App

I am writing an Azure function app to receive a file uploaded through a multipart/form-data HTML form. I think the only way to get my uploaded data is by probing ...
1
vote
0answers
2k views

Navigate a WebBrowser control asynchronously

I wrote a little method to navigate a WebBrowser control asynchronously and returns DocumentResult, yet i wanna know if this is ...
1
vote
0answers
111 views

Remove array items in an array in a CouchDB document

In this project I'm working with NoSQL databases (couchdb) and Node.JS using ES7 (via Babel). This is my code to remove items from an array of addresses in a JSON document. If you see something that ...
1
vote
0answers
2k views

Indefinite loop in a coroutine vs. re-scheduling a coroutine

I recently started working with asyncio and coroutines. I have a coroutine that runs every 0.25 seconds to print "running ..." on screen indefinitely. When the script receives a SIGTERM or SIGINT it ...
-1
votes
1answer
1k views

Ado.Net and Async insert of many rows to db

I have implemented repository in Ado.Net which insert data to many tables. I insert all in one transaction and use async/await to improve performances. If you have any suggestions have to improve my ...