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

3
votes
1answer
48 views

Event Subscriber with Parallelism

I am trying to exploit asynchronism for parallelism. This is my first attempt at a parallel event subscriber. In your expert opinions, is this a valid approach? ...
4
votes
2answers
789 views

Running Code Just Once

I want a code run just once (say in Dispose). WriteOnceBlock<T> from TPL Data Flow could be used here; but again if we ...
1
vote
1answer
80 views

TCP Server with multithreading

I am working on a banking application. I want to create a multithreaded TCP Payment Card (iso8583) server that can handle passbook printing requests simultaneously. Multiple devices are connected to ...
4
votes
1answer
48 views

Asynchronous API calls with delegates and event handlers

I'm making a WindowsPhone 8 app in C#. With this an API so I can convert JSON data into useful objects. I've found a method but am wondering if it is any good at all. The problem is it's been a while ...
0
votes
0answers
15 views

Looking for a simpler way of using an asynchronous function without directly using its callback

As the title says "Looking for a simpler way of using an asynchronous function without directly using its callback.". I hate functions and re-writing callbacks by "intercepting" them and passing the ...
2
votes
1answer
38 views

Simplify double AJAX request for jQueryUI's autocomplete widget

I'm using jQueryUI's Autocomplete widget for a product search. The data is in a database, so as the souce I passed it an AJAX request. My problem is, that I need some data about the currently focused ...
4
votes
1answer
79 views

Asynchronously wait for a task to complete and do some async action while waiting

I have a long-running task. My goal is to create a method that will allow me to: Asynchronously wait for this task to complete While waiting on a task, do some async action once in a while. This ...
4
votes
1answer
90 views

AsyncTask which allows to handle exceptions on UI

The AsyncTask available in android, gives you the result from doInBackground on the UI thread so that you can update UI ...
0
votes
0answers
59 views

Functional Typescript/Javascript

The past month I've been trying to learn Javascript through Typescript and my adventures have led me through the subjects of asynchronous and functional programming along the way. In order to try and ...
6
votes
2answers
61 views

Buffering of fast changing datapoints or events

The following class implements a buffer which captures fast changing datapoints or frequently raised events and dispatches them in batches. It will asynchronously call a processing function for the ...
3
votes
3answers
163 views

Implementing a POC Async Web Crawler

I've created a small proof of concept web crawler to learn more about asynchrony in .NET. Currently when run it crawls stack overflow with a fixed number of current requests (workers). I was ...
8
votes
2answers
171 views

Concurrent Task Waiter 2

This is an iteration of my previous question: Concurrent Task Waiter Summary from before: I have some code designed to simplify managing multiple asynchronous operations. The code creates ...
1
vote
1answer
55 views

Concurrent Task Waiter

I have some code designed to simplify managing multiple asynchronous operations. The code creates callback actions that, when executed by the asynchronous operation, track which asynchronous methods ...
2
votes
1answer
39 views

Move uploaded file

As I mentioned in Node.JS fs.rename can not move files in right way. And it should be solved with stream piping. Please verify this code and answer questions in comments: ...
5
votes
0answers
228 views

Clojure core.async web crawler

I'm currently a beginner with clojure and I thought I'd try building a web crawler with core.async. What I have works, but I am looking for feedback on the following points: How can I avoid using ...
3
votes
1answer
122 views

Clock mux for allowing glitch-free muxing of asynchronous clocks

This clock mux is meant to allow glitch-free muxing between asynchronous clocks clk_a and clk_b via a (also asynchronous to both ...
4
votes
0answers
136 views

Asynchronous Array.map

I put together an asynchronous map function for Swift's Array using Grand Central Dispatch. It's called with a transform ...
3
votes
1answer
120 views

Solving the Shortest Path problem (little bit of TSP, too)

Some background info: I'm working at a shipping company and the company's web developer has been fired a week ago. My boss knew that I had some knowledge in web development, so until we get a new ...
6
votes
5answers
534 views

Calling many web services asynchronously

I need to process a bunch of completed orders (thousands). To make it faster, I'm using a SemaphoreSlim to schedule a number of orders to be processed in parallel. ...
3
votes
1answer
74 views

Shorten my asynchronous DB queries, using async.js module

I am using Node.js Express.js node-mysql.js async.js I am making multiple asynchronous queries to my DB, but every query relies on the previous one's results, so I decided to use the ...
4
votes
2answers
84 views

Fetch details from server

I am using this code to fetch some details from server from my android app. How can I improve it? Here I am also transferring some data from one activity to another. This is how I have written my ...
2
votes
0answers
72 views

Validating asynchronous behavior

I have a large service application I designed; it's a solution made up of about 30 projects. I was wondering if anyone could point me in the right direction regarding using the Task-based ...
3
votes
2answers
133 views

Read multiple files async

I want to read multiple files simultaneously and apply the same function on data. This code works correctly, but can someone please suggest any better way of writing this? ...
6
votes
1answer
73 views

Blocking and async UDP communication with an IR camera

I'm writing a Java application to control a custom IR research camera that will be installed on an aircraft. The camera connects to the the computer using UDP sockets via a direct LAN cable. The ...
7
votes
1answer
1k views

Simple Async Google Maps initializer with AngularJS

Here is a simple reusable AngularJS factory I came up with to initialize Google Maps Asynchronously, which somehow does not seem ...
2
votes
1answer
83 views

Is it a good idea to have a public inner class as a runner for a service?

I have a service class that handles recipe management using a piquetteClient (piquette is a web app with a rest API that can run puppet scripts). The thing is ...
5
votes
1answer
171 views

Is this SqlConnection / SqlCommand async wrapper both efficient and correct?

This is my first time writing async code, I intend to inject the interface IConnection into other classes in my project. Can you please tell me if the implementation class Connection, is the correct ...
6
votes
3answers
198 views

Running 2 sets of tasks at the same time

Currently, my team and I have 2 types of databases that are updated periodically, SQL Server and Access. Also, we run specialized reports based on those databases. Basically, we have 4 tasks that ...
2
votes
1answer
156 views

Tasks and WaitAll\WhenAll

Could you help me to speed up/optimize this code: ...
3
votes
1answer
122 views

Is this a sensible way to throttle duplicate requests in a HttpModule?

I'm writing a method to throttle duplicate requests taking place within multiple HttpModule instances within a web application. Currently I have the following ...
1
vote
1answer
107 views

Async function with slow web reference(web service) slowing down webpage

Is there a way to make a threading/async post with a web reference not slow down the whole website just because the web reference takes a long time to return a response? I have a send email function ...
3
votes
1answer
192 views

.NET WCF Activator for sync and async calls

I decided to re-write my code responsible for WCF calls, as all of my methods had try-catch-...
6
votes
1answer
164 views

Is this a good approach to loading JavaScript files asynchronously?

I want to load JS files asynchronously to speed up page loading, but also need to execute JS code only once the scripts finish loading (so I need a way to implement callbacks). I based this off of ...
1
vote
0answers
118 views

Questions regarding the use of Requests Futures for accessing REST URLs

This is a much simplified version of the real code focusing just on the handling of Futures from Requests Futures. I have a few questions: I had to implement my own version of ...
5
votes
1answer
232 views

Oauth 2.0 handler functions for Tornado

With Tornado 3.2 they made some updates to auth module and have updated the code. Earlier I was using open id for Google login, since it will be deprecated in the future I am switching the code to ...
5
votes
1answer
408 views

Verifying the type of an AggregateException's inner exception in a unit test

I've got the following code inside an integration test. ...
2
votes
1answer
255 views

Async method with multiple tasks

I'm trying to make my ASP.net Web API methods asynchronous. This method is in the Business Logic layer of my N-tier. I'm waiting for the result from my 1st task and use it on the 2nd task, but I ...
2
votes
2answers
278 views

Simple Deferred / Promise pattern in JavaScript

I've wrote a very simple implementation of Deferred / Promise pattern (inspired by jQuery's $.deferred) for my tiny project (which does not use jQuery) It can ...
2
votes
2answers
2k views

Generic HTTP using Android Asynctask

I have developed a generic HTTP functionality using Android Asynctask and Apache HTTP client. Please review the code and let me know if it is the right way of doing or there are other ways to achieve ...
2
votes
1answer
134 views

nodejs grunt plugin using async module

I'm looking for some code review of my usage of async. Mainly why this does not work without the done = this.async() method and why I don't have to invoke 'done()' ...
2
votes
1answer
87 views

Views Counter made in Python, Gevent and MongoDB

I've created a Views Counter in Python, Gevent and MongoDB (Flask is also included in the full stack as you can see from the context issue in the code). My gut still tells me that it can be still ...
3
votes
2answers
103 views

Asynchronous Pattern

I have an n-tier solution which consist of DAL,BL and a ASP.net WebAPI project. I'm new with Asynchronous Pattern and I'm trying to add it to my Framework. Am I doing asynchronous pattern correctly? ...
5
votes
1answer
133 views

Minimal but complete AMD implementation

I've got a minimal implementation (under 2k minified) of the Asynchronous Module Definition API. So far it handles all of the required stuff (I think; it passes the relevant unit tests, anyway), and ...
1
vote
1answer
50 views

ThreadSafe IsoStorageManager

This is a continuation of the last thread. I wanted to add a thread-safety and I was considering AwaitableCriticalSection and Task+Mutex. I ended up with mutex; it can be a bit slower but it would ...
1
vote
1answer
682 views

Async Log4net logging handler - High CPU usage on async call

I've got a LoggingMessageHandler that incoming requests on my WebApi application filter through. ...
2
votes
1answer
174 views

Cleaning up nested promises in Cloud function

I am writing the Cloud function for Parse whose purpose is to update my database with a provided array of data objects. The main problem are the nested promises, which doesn't look right. Any help ...
2
votes
1answer
78 views

How to simplify this promise-driven animation code?

Inspired by this question on StackOverflow I've attempted to code such animation, mostly to get some more practice with async, promises and Q.js. Here's what I got: (Live demo) ...
0
votes
2answers
232 views

Promises and chained calls

I've realized JS callback hell and I started looking into Promises libraries. After reading some articles I decided to start with BluebirdJS. I didn't realise how to properly use them yet, because ...
5
votes
1answer
424 views

Load JSON file into model using Javascript / jQuery (deferred, asynchronous)

As a beginner I am always determined to improve myself. I've got written the following Code using jQuery that is working fine. However, I am sure that there are cleaner ways for achieving the same. ...
8
votes
2answers
665 views

Echo server with CompletableFuture

I recently wrote a simple echo server in Java 7 using the NIO APIs so it was asynchronous and non-blocking. Then I decided, as a learning experience, to redo it with Java 8 hoping to use a more ...