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
vote
0answers
29 views

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

(Repost from SO since I got recommended to post it here instead) tl;dr: Is there a way to make a threading/async post with a web reference not slow down the whole website just because the web ...
3
votes
1answer
40 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
84 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
54 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 ...
3
votes
1answer
43 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
63 views

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

I've got the following code inside an integration test. ...
1
vote
1answer
99 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
115 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
1answer
57 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
46 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
81 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
81 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
28 views

ThreadSafe IsoStorageManager

Continuation of the last thread. So, i wanted to add a thread-safety and i was considering AwaitableCriticalSection and Task+Mutex. Ended up with mutex: it can be a bit slower but it would allow ...
1
vote
1answer
151 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
66 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
66 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
74 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
184 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. ...
6
votes
2answers
230 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 ...
5
votes
1answer
68 views

AngularFire Tic Tac Toe Game

I am building a Tic Tac Toe game with AngularJS and making it online playable with AngularFire. The Tic Tac Toe logic is all there so this question concerns Angularfire a little bit more. I want to ...
2
votes
0answers
46 views

Thread Safe Events while utilizing EAP

This is my code for a server using EAP (Sockets). Is AsyncOperation.Post is the right way to raise thread safe events? AsyncOperation.Post states: Invokes a delegate on the thread or context ...
6
votes
2answers
188 views

Interface implementations: sync methods in terms of async methods

Say I have an interface and I want to expose both synchronous and asynchronous options for performing an action: ...
4
votes
2answers
360 views

Wait until all files are loaded asynchronously, then run code

I'm an experienced programmer but not too great at JavaScript so I'm looking to see if I'm doing this 'right'. I want to have several files loaded in (Ajax or really AJAJ) and, once loaded, run some ...
3
votes
0answers
293 views

Optimizing async joins for mongodb (mongoose) using async.js

I'm building a media viewer web app for a kiosk in node that uses data in mongo. To render the viewer, it gathers together all the Asset objects (representing video files), each of which belong to a ...
5
votes
1answer
409 views

Writing highly asynchronous code

I am writing a new web service that will be performing a lot of large data load operations. To do so I am moving the data to a temporary table then merging the data in to the live data via a stored ...
2
votes
1answer
113 views

Is this a good use of Async in F#?

I've hacked together some code to read the content from a sequence of files: ...
3
votes
0answers
60 views

Queue with “unlimited” buffer in Go

This is small piece of bigger puzzle, but usable by its own. It an attempt to have a nonblocking queue with "unlimited" (besides memory size) buffer length. Got unit-tests 100% statement coverage, it ...
3
votes
0answers
221 views

Aysnc call back to UI Thread

My main DLL is a .Net one that has an async running method and fires an event when it's done: ...
7
votes
1answer
627 views

Continuously receive messages async from Azure Service Bus Queues

I'd like to get input on my approach of continuously receiving messages from an Azure Service Bus queue using the async part of the library. My main concern being whether its "safe" to use ...
2
votes
2answers
2k views

Android AsyncTask, HTTP Request and Parsing

I am working on Android applications for last 2 years and about 80% applications I have developed involve web-services consumption followed by some sort of XML or JSON parsing. Initially, when I had ...
10
votes
2answers
816 views

BackgroundWorker vs TPL ProgressBar Exercise

I wanted to fiddle around with the BackgroundWorker and Task classes, to see how I would implement a given task with these two ...
3
votes
0answers
93 views

Semi-synchronous Programming in Python

I just took a stab at creating a library for something I'm dubbing semi-synchronous programming (async + dependencies). It's rather dense, but I'd really appreciate a quick code review to ensure I'm ...
1
vote
0answers
48 views

Paginated Backbone.Collection subclass

This is a subclass of Backbone.Collection with a method fetchNextPage that returns a Q promise. To find out the next page's ...
1
vote
1answer
144 views

Best way to handle the error in async node

To catch errors, I have written if-else blocks in every function which looks bad. Please suggest a better way to handle errors in async node. ...
4
votes
2answers
93 views

Refactoring asynchronous JS pre-rendering code

A few months ago I wrote this module but, coming back to it, I find it a bit hard to read and reason about. I want to ask community's opinion on whether this needs to be refactored, and how I could ...
2
votes
1answer
216 views

Limiting Q promise concurrency in JavaScript

I wrote a helper to limit Q promise concurrency. If I have a promise-returning function promiseSomething, writing ...
3
votes
1answer
723 views

Node.js Async Callback Hell

Attempting to create a final array with data pulled from 3 functions. The first two functions have all the data but then the 3rd function needs to run looping through one of the fields from function 2 ...
2
votes
1answer
320 views

Generic Task Progress Dialog

I'm attempting to write a Progress Dialog that I can instantiate, show and then pass a task to complete to. I'm pretty new to Task Based Patterns, so please bear with me. Ideally my goal is to be ...
4
votes
1answer
538 views

simple ThreadPool implementations

I would like to ask you for a code review of my c++11 Thread Pool implementation. Your constructive criticism is welcome! Could you give me some ideas how to extend it? The main idea is to ...
6
votes
3answers
258 views

“Proper” Asynchronous implementation

I need some opinion if my code below is proper for an async process. This code only reformats text. Please let me know if this implementation is not proper or needs some improvement. ...
3
votes
1answer
430 views

AsyncTask for handling server api calls

Got this design for getting rid of checking network availability and informing user of errors. Is it good at all? Please, help. Overall point is to fire server call as short as possible: ...
1
vote
1answer
544 views

Node.js DynamoDB callback

I am writing an API which gets results from a DynamoDB table and puts the JSON back into the browser. The code below works and returns the desired results. However, after reading about async and ...
2
votes
1answer
210 views

Am I using Q the right way or is there a better way to do what I'm doing?

I'm using Q to flatten out some callbacks in my unit tests and return a promise to mocha (which knows to wait until the promise is resolved before running the next test). Originally I had this code: ...
2
votes
1answer
200 views

DAL Efficiency Help

I am attempting my first try at some c#. So far I love it, (not more than vb tho ;)) however, I am wondering if I can make these classes a bit more efficient. Please note ###Test is my attempts at ...
1
vote
2answers
746 views

Static classes, singleton and thread-safety

I have a classes for work with a web service (Windows Phone 8 app). I will briefly describe what doing each. My main question is the thread-safety of the ...
2
votes
2answers
223 views

Timer factory fn optimization

I use this Timer function quite a bit lately for all sorts of stuff, and would appreciate if someone could review/analize/criticize/verify and, of course, suggest things I can do to optimize it for ...
1
vote
0answers
800 views

Javascript Queue for async functions

Based on the answer to my previous question on Stack Overflow, I put together the following Queue class. I realize there are already libraries out there to do this. However, I wanted to actually ...
1
vote
1answer
157 views

Can these async tasks be merged together?

The following code works but is slow and I know can be better, just don't understand how to make it work. The end result is displaying the actual driving distance from the users current location to ...
1
vote
1answer
91 views

Node.js/javascript: synchronizing async tasks

Yes, I know there are plenty of libraries to get this done (Q, step, async), but only for learning I'm wondering if the following code is ok and usable or have major drawbacks and it is only usable at ...
1
vote
0answers
512 views

Asynchronous Server Sockets - Thread-Safety/Performance (MMO Gaming)

I'm writing this game server for my small 2D MMO game. So here are my questions: What do you think about the Thread-Safety of the code? Please explain how can it be made thread-safe / show example/ ...