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.

learn more… | top users | synonyms (1)

2
votes
1answer
75 views

Simple multi-client echo server

I've been looking at some async comms in C#. As a proof of concept, I've written a simple multi-client echo server. The server allows multiple TCP clients to connect and listens for input from the ...
2
votes
1answer
36 views

Threaded and asyncio API library

In Python I am trying to create an API for a connected device. I want to be available for both threaded (using request) and async applications (using aiohttp). What I've come up with is wrapping the ...
3
votes
0answers
32 views

Converting MongoDB's IAsyncCursor(Source) into an Rx Observable Sequence

I've been toying with this idea for quite a while. Needless to say that this really enables a lot of possibilities, Especially when combined with a SignalR Backend. Added below is what I came up with....
2
votes
2answers
79 views

Calculating Pi with Android

I'm kind of new to Java but I am writing an Android app. Right now I'm working on an async task to calculate Pi but when I run it the memory usage increases alarmingly (+5MB per second). This one ...
0
votes
1answer
36 views

Async TCP connection that handles reading and writing

My situation is as such: I must connect to a server via TCP, at the end of the session (several hours), they will close the connection - throwing an exception that should be gracefully handled I need ...
3
votes
0answers
38 views

Daemonizing shell scripts - MqSH

This is an mqtt driven, interactive, and asynchronous remote shell daemon written in bash. I call it "MqSH" or simply "mq". It works with bash, the busybox ash shell, and perhaps other Bourne-like ...
3
votes
0answers
37 views

Reading log file of subprocess

I run subprocesses with lot of output (compilation of Unity 3D projects). I use log parsers to find known issues. ...
2
votes
0answers
37 views

Waiting for all task to complete while catching exceptions early

I'm working on simulating a number of processing elements (nodes) which do some work in parallel and communicate by exchanging messages. The message exchange is not in the scope of this post, but it ...
1
vote
1answer
45 views

A Simple Async Task in Clojure

Purpose of Code: To simulate scraping the web and updating a db, by, presently, adding randomly generated numbers to a "database". Have I wired up the followin async code properly? Is there a simpler,...
0
votes
1answer
86 views

HttpRequest class using AsyncTask for Android application

I am using the following class to retrieve a http response, which contains data for my Android App. Everything works fine, but there is a performance issue. I get the following warning when requesting ...
2
votes
0answers
43 views

Timeline request function for Twitter bot

I'm writing a Twitter™ bot for the Retrocomputing Stack Exchange site using JavaScript. To ensure that it doesn't tweet about the same question twice in a row, I request the account's timeline. ...
3
votes
1answer
116 views

General Retry Strategy #2

Previous version Now supports async operations and cancellation. Let’s say we copy some file using retry strategy (it might be blocked, etc.). App code comes bellow: ...
2
votes
0answers
68 views

Handling async in Clojure

I've defined myself a function for caching requests and their responses in a browser environment; I'm using ClojureScript. ...
4
votes
1answer
83 views

Asynchronous database query system using futures-rs in Rust

Background I've been working on an algorithmic trading platform in Rust and utilizing the newly released futures-rs library to keep everything asynchronous and non-blocking. One issue I've come ...
0
votes
0answers
67 views

Download of files in Async task for Android

I am using AsyncTask in Android to download files from the server. Is there a way by which I can improve the process? Can the download happen any faster? Is there a ...
3
votes
1answer
43 views

Make one greenlet tell another to shutdown

I am building a commandline app to check proxies, which has a daemon flag (running forever or just once). There are producers, checkers and storers. I want them to run in parallel and be able to ...
2
votes
1answer
76 views

99 simple asynchronous bottles on the wall

I have some basic code which registers functions, with given variables, to be executed after a certain time has elapsed. I will roll this code into my software project when it is ready. If it works it ...
0
votes
0answers
33 views

Factory for ListenableFutureCallbak

I'm developing a Rest API, and at the moment i have a bunch of controllers like this one: ...
1
vote
0answers
270 views

Handling Firebase's asynchronous calls Android

I have written a helper class to manage callbacks from Firebase's asynchronous calls. Can this be implemented in a better way? ...
4
votes
1answer
62 views

Asynchronous task execution using actor based concurrency

I have a program where I need to implement asynchronous tasks (writing a directory to a file following any change to the directory). There is existing documentation within my organization for ...
3
votes
1answer
64 views

A Switch for async function invocations

I have implemented a simple "switch" function - that switches and invokes an alternate function, if the function that is to be invoked fails or timesout. This code will be later employed as part of ...
1
vote
1answer
81 views

WPF Mvvm async function ViewModel

I worried about this code in a ViewModel. ViewModel shoud not contain any code exept binding's. But without async update ui should stuck. How to improve it? The main problem that this is need to be ...
5
votes
1answer
54 views

Async.sequence implementation

I have a simple implementation for "Async.sequence" (the name came from here), but I would like someone to review it for performance, tail call optimization, and ...
2
votes
2answers
65 views

Reading genetic data in VCF and Tabix formats using an asynchronous library

I'm working with an open-source library for processing and parsing genetic data in VCF and Tabix formats. It contains functions and classes that make it easy to read an index file (a Tabix) and load ...
7
votes
1answer
148 views

Make Simultaneous HTTP Requests That Resolve Into a Single Return

This week, in an ongoing job search, I was tasked with the following pre-screening question: Make two simultaneous http requests. Use the language and library of your choice. Make sure the results ...
2
votes
1answer
81 views

Android network API request

I often use a similar scheme work with an API project. Can it be made easier, or is there a standard approach? This class creates an API request: ...
-1
votes
1answer
570 views

Synchronous loop with internal asynchronous calls

Below I've written a simple version of what I'm attempting to accomplish. I'm new to asynchronous functions, so it's difficult to wrap my head around this. My goal is to wait for the loop to finish ...
2
votes
1answer
166 views

Retrieving the lotto numbers - Node.js

I'm looking for feedback as to how I've structured the async calls, and If anything should be written differently. endpoints.js ...
1
vote
2answers
48 views

Using promises to GET and process data

I'm working on a Meteor application which integrates a user's contacts from external sources (Google in the case of this example). I'm currently writing the server side code to retrieve this data and ...
0
votes
0answers
57 views

Register a node-client code through an API call efficiently?

I've got a node_module that reads ArcValues for a user and updates the config of the node client at user's local (root). Like so: ...
2
votes
0answers
48 views

API design for loading OpenGL textures asynchronously

What do you think about this API for loading OpenGL textures asynchronously? My main concern is that the loader class executes code on the client io_service. This takes away some control from the ...
3
votes
1answer
43 views

Retrieving the Currently Logged in User's Department

I hope this is the right place for this. I basically wrote the below script for a SharePoint 2013 where I needed to get the department of the currently logged in user. I was finally able to get it ...
2
votes
2answers
53 views

Async Implementation

I'm seeking code review comments for the following implementation. jsFiddle ...
0
votes
1answer
79 views

Composing IO and Async in haskell

Whether based on MVar or TVar, async implementation are always based on operation on some underlying monad IO and STM. Making Async a monad on its own, as in F# async computation builder, if done in ...
4
votes
1answer
122 views

TryRetry - Try, Catch, then Retry

I have created a class to try, catch and retry N times. My class also supports retrying asynchronously. I'm wondering if there are better ways to implement this. I'm most concerned with the ...
1
vote
1answer
134 views

Implementation of API to create a company account in a database

I'm working on an API that has a lot of controller functions like this: ...
6
votes
1answer
504 views

Login UI for an Android app

This code starts a new thread for login and reacts according to the JSON result returned by the server. I think this code has too many conditionals, exception handlers, and nested functions. ...
3
votes
0answers
146 views

Golang Tour Web Crawler Exercise

In the last few days I've played around with Go a little and took the language tour. The last exercise (text here) requires you to crawl a graph that simulates a set of Web pages with links, using ...
4
votes
2answers
156 views

Calculating pi by adding areas of thin rectangles

I wrote a small program for fun to try to prove Pi by taking a certain precision and radius and using it to calculate the area of the circle. My method should be giving me an area that is just ...
5
votes
0answers
119 views

Prevent multiple async calls from all attempting to refresh an expired OAuth token

I have some code that needs to access an API that requires OAuth authorization in the form of a token, and every time the token expires, it needs to be refreshed. I made a function called ...
-1
votes
1answer
255 views

async tcp server using async/await

Here is an async Tcp server using async/await I have written. I would be very appreciate if anyone can help to improve my code. Thank you! ...
1
vote
2answers
97 views

Spawning futures as an alternative to multithreading

I was trying to do a sample threading program, where the spawning of thread is in a while loop. I DO NOT want to generate multiple number of threads. The while loop should keep on running, ...
1
vote
1answer
788 views

Custom HttpClient Wrapper

I need to wrap httpClient because I'm using a custom token provider. I will use this code with asp.net mvc to communicate with our webApi2 server. ( Using webApi2 with directly from ui with angularjs ...
2
votes
1answer
136 views

XCTestCase#waitFalseExpectationUntilTimeout implementation

I am working on an iOS project and I'm in charge of testing most parts of it. As I write some tests, I often have the need to wait for an asynchronous method to finish, and then test that something ...
0
votes
1answer
57 views
3
votes
2answers
136 views

Queuing e-mail notifications in a background thread

I'm new to parallel programming concepts. I'm trying to implement fire-and-forgot kind of method in my project. Somebody please evaluate the below code & let me whether this is thread safe or not. ...
7
votes
0answers
412 views

Node.js parallel file download, the ES6 way

I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to ...
1
vote
1answer
49 views

Callback of setTimeout function when performing synchronous actions

Inside a function I'm calling playgame service. Once I've obtained the needed data (gameBeingPlayed), I need to show a 3..2..1 counter and then start a game. ...
1
vote
1answer
50 views

Iterations with asynchronous functions

I haven't really worked much with asynchronous code so I'm wondering if I am doing something wrong/something could go wrong. Right now of all the test cases that I have done, my code has worked but I'...
2
votes
0answers
46 views

Execute coroutines in pool

I want to run all the coroutines from the list in a pool of constant size and would like to ask if this is the right way how to achieve it. Is there any built in solution for this problem? I have not ...