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

5
votes
1answer
40 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. ...
5
votes
1answer
32 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 ...
1
vote
0answers
21 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
115 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
78 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
38 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 ...
4
votes
1answer
115 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
82 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
41 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 ...
2
votes
0answers
95 views

Aysnc c++ call back to UI Thread

My main Dll is a .Net one, that got an async running method and fires an event when it's done: ...
6
votes
1answer
224 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
430 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
325 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
54 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
28 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
69 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
72 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
111 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
330 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
181 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
331 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
228 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
188 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
308 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
121 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
181 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
412 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
217 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
587 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
85 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
357 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/ ...
1
vote
1answer
226 views

Is this factory method a good approach?

We are beginning to learn Node.js and we are not always sure if we do it the right way. We have a strong object oriented background so the adoption is not always easy. Right now we implemented a ...
1
vote
0answers
415 views

WCF using TAP without worrying about timeouts

I am really liking using the new TAP pattern in .net 4.5. And am updating some of my older projects to use it. One of the old patterns I used to use was to use EAP with WCF so I could have functions ...
5
votes
2answers
6k views

TCP async socket server client communication

I develop my first async TCP socket server and client program in c# and would like to review the first parts of it. I like to get some information’s about smelly code that I missed and what I could ...
2
votes
2answers
638 views

Asynchronous version of AutoResetEvent

This is my second attempt to create asynchronous version of AutoResetEvent. At first I tried to make it completely lock-less, but it turned out to be impossible. This implementation contains a lock ...
6
votes
1answer
148 views

AutoResetEventAsync, am I missing something?

So I wrote an asynchronous version of AutoResetEvent: ...
1
vote
1answer
825 views

Simple Telnet Chat Server nodejs (correct way to write programs in node.js (asynchronous programming model))

I am new to node.js and asynchronous programming and this is my first small project to learn it. I have written a small Telnet Chat server and the program works but I want to know if this is the ...
2
votes
1answer
185 views

Am I using async C# correctly?

I have the following bit of code the calls out to two different command line components (each wrapped in their own Task) ...
2
votes
1answer
3k views

Use and Understanding of async/await in .NET 4.5 +

All, please take the following example code ...
1
vote
1answer
826 views

TPL Thread Leak and Memory Leak

I'm trying to track down what I suppose to be memory/thread leak in one of my programs. My program uses a function to upload a file to a Windows Azure Storage Blob. In order to make this function ...
0
votes
1answer
89 views

Perfomance and Other Improvements

I am trying to wrap my arms around all the digital files we have, so I thought I would organize all of our pictures and videos into folders named after dates. I'm learning F#, and this felt like a ...
2
votes
1answer
357 views

Putting called delegate into AsyncState parameter - Pros/cons?

I have the following interface: ...
2
votes
1answer
3k views

Correct approach to wait for multiple async methods to complete

I have an IWorkflow interface defined as follows: ...
2
votes
3answers
247 views

(async) Task “Keeper” for keeping the “fresh” data - How do I improve this?

Background I retrieve data from a 3rd party API, over HTTP. It's often slow, and sometimes just fails. I needed a class that would keep getting data from that source, and keep it in memory. So, ...
3
votes
1answer
196 views

Very simple async MixpanelAPI

I would love to hear feedback on my first open source project (a very simple async API for Mixpanel). It implements a REST client for this REST HTTP API. Review requested on the following aspects: ...
2
votes
3answers
350 views

Polling a email using async / await

I've created a create a console app that would: Call a method to check an email account (I've done this step) Convert the attachment to pdf (I've done this step) Then once the conversion is complete ...
3
votes
1answer
283 views

Interview example [closed]

Recently I participated in an interview for a Russian company in Moskow and could not answer some of the simple questions. One of them I would like to ask here. List all problems which you can see in ...
8
votes
2answers
4k views

Real World Async and Await Code Example

I have been looking everywhere to find good real world examples of the new Async and Await features in .net 4.5. I have come up with the following code to download a list of files and limit the number ...
1
vote
1answer
278 views

Calling a function when all asynchronous calls complete

Below is a simplified version of some code I am using to execute a function after all asynchronous calls complete. Is this a reasonable piece of code? It seems to work. Nothing would break if ...