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
87 views

A redundant data service

I've got a service that loads data from a databasr and it performs almost the same operations in all methods. ...
0
votes
0answers
13 views

Async boolean expression evaluator in ES6

This is a pretty simple Node package designed to accept a "boolean expression" and evaluate it asynchronously. The full project is on GitHub. Essentially, an expression like ...
2
votes
3answers
86 views

Task with feedback dialog helper class

I'm currently working in a Windows.Forms project where its very common that I need to show a responsive feedback form while a task runs. These tasks take typically ...
1
vote
1answer
48 views

Reading text from the web and writing to a JSON file

This code reads text from the web using a WebDriver element and writes data to a JSON file. I had to use if-...
0
votes
1answer
35 views

Loading images in the background for a table view

I have "fetchData" method which fills my "imagesArray": ...
1
vote
3answers
115 views

Implementing an asynchronous mutex in C#

I wrote a simple synchronization primitive that I can use with async operations on an external REST service so that I don't call it twice from different threads and have one call fail due to not ...
1
vote
0answers
78 views

Are there pitfalls to this solution to read messages from a queue in parallel?

I've posted a question on stackoverflow: How can I consequently read messages from a queue in parallel? I would like my own answer to be reviewed. Situation We have one message queue. We would like ...
4
votes
1answer
78 views

Asynchronous start/stop state transitions

I have a third-party object with asynchronous start and stop methods. Each start and stop may fail with exception. The object is not re-entrant, i.e. I can only call its start or stop method after the ...
6
votes
1answer
65 views

Async telnet connection over StreamSocket

My team and I have a very poor understanding of best practices in relation to telnet. We have Task.Delay and Task.Wait in the ...
7
votes
1answer
95 views

Refactoring of a client API to avoid duplicated code and unclear passage of parameters

I need to develop an API. The functions of the API are requests that call the services exposed by a server. Initially the API worked like this: ...
17
votes
3answers
307 views

Synchronous / asynchronous REST client

I have working code with original design, and now I had a slight design change so trying to code review that as well. I already had code review on my original design here. Original Design: I am ...
4
votes
1answer
57 views

Angular using defer and services

I have wrote some service in AngularJS that use defer, can you check my code and tell me if I getting it right? Service (I dont really like name: ...
7
votes
1answer
169 views

Generic asynchronous SQLite search builder

I am writing a database manager that reads and writes to a local SQLite database on a mobile device. It works pretty well for the most part, but read access is somewhat slow - it takes about 2-5 ...
0
votes
1answer
56 views

Getting data async

I need to handle concurrent requests by waiting for the result of an already running operation. Is this code safe or does it contain bugs? ...
3
votes
2answers
74 views

Async task with timeout

I am calling a service outside of my control. My application must include a time out, so that if the call to the service takes too long, an appropriate time-out message is returned. ...
2
votes
2answers
88 views

Producer/consumer implementation using Tasks and BlockingCollections

I'm implementing a Producer/Consumer but the generic interface doesn't require any knowledge of blocking collections or tasks. ...
2
votes
1answer
60 views

Multithreading, shared queue as synchronization point

I have two threads, one produces images and one processes them. For the synchronization, I created a class where you can set and get images, and it always waits until an image is available or a worker ...
0
votes
1answer
58 views

Calling synchronous code in asynchronous method

I'm implementing an interface with the async method Execute. In this I need to call some synchronous code. (removing an item from a dictionary). What would be the ...
1
vote
0answers
39 views

Simple registration form in NodeJS

I'm creating a simple registration form, but stuck somewhere. I want to use token variable in new user() scope, but if I put ...
1
vote
1answer
156 views

Updating WPF MainWindow from an async task

Is this an acceptable approach to update WPF MainWindow from an async task, using events thrown from a public static class? In MainWindow.cs, I subscribe to ...
3
votes
2answers
385 views

Complete async OpenSSL example

I am trying to create a fully async example of a client and server using SSL. I think these are the required assumptions: Connecting may require socket readability and writeability notifications. ...
1
vote
1answer
103 views

Updating sychronous code to run asynchronously using async/await

I maintain an application that has a method in a class for saving uploaded files to filesystem and I want to run asynchronously as it saves multiple files in a single request. I don't know if it's ...
3
votes
2answers
38 views

Asynchronous model fitting that allows termination in Python

The problem When you work with Python interactively (e.g. in an IPython shell or notebook) and run a computationally intensive operation like fitting a machine-learning model that is implemented in a ...
5
votes
1answer
47 views

Process chain approach

I've been researching about JavaScript and jQuery function chaining and different callback techniques. I am trying to create a very generic code that allows chaining, and in a way that I may create ...
7
votes
2answers
295 views

Non-blocking, non-threaded HTTP client implementation

This is a C# WinForms program targeting .Net 4.5. I am using it for a movie organizer application that will contact sites like OMDB, MyApiFilms, etc. for data about the movies. At the main application ...
2
votes
1answer
51 views

Java basic AsyncCache implementation

I wanted to use an async-cache to store URLs of images that I have to display in a list. The image URL is fetched (REST call) using a unique UUID associated with each item of the list. I store this ...
7
votes
1answer
112 views

Cancellable futures, interaction with throwing destructors

I'm reinventing std::future from scratch (for an upcoming talk). I'd like to incorporate as many of the latest and most likely-to-succeed proposals as possible, and ...
6
votes
1answer
102 views

Dining Philosophers Problem in Clojure

I have implemented the Dining Philosophers Problem in Clojure with refs, trying to emphasize readability. Please point out if parts of it are inefficient, not idiomatic, or improvable in any way. Full ...
4
votes
1answer
186 views

Using Grand Central Dispatch to fetch data from Parse.com and update UI asynchronously

This works, and the UI is snappy in the simulator, but since this is my first time really using GCD, I'd just like this code to be reviewed before I start using it everywhere. Note that this is ...
2
votes
0answers
64 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: ...
10
votes
2answers
498 views

Chaining asynchronous tasks that must run sequentially

I want to implement an Agent-like object in C#. An Agent wraps some memory location (ideally storing an immutable object) and receives updates to that location. All ...
3
votes
1answer
33 views

fork_call every 'n' seconds in AnyEvent

I need to run fork workers every 5 seconds. Is there a way to do it more ideomatic? I'm embarrassed about $running variable. ...
2
votes
1answer
463 views

MVC Repository Insert Using async

This is practically my first time using async in my code. I read about dos-and-donts but I wanted to get some feedback on what I've written. I'm using a repository ...
3
votes
1answer
64 views

Simple wrapper to use IEnumerable as a producer in a producer-consumer pattern

I have a relatively simple problem: I have an IEnumerable<T>, which takes considerable time to yield each term. This is then used by another piece of code, ...
0
votes
0answers
38 views

Method to get data from redis and return as array

I am using chaining for such code. I have tried to make async.map but it's now real mesh for me. How can I make this code more robust and right? ...
2
votes
1answer
940 views

Getting messages asynchronously using MailKit

I'm writing a prototype for an application that uses MailKit and imap to connect to gmail. It's the first time I've used MailKit and I'm a bit stumped around the best way to do this. Essentially, I ...
0
votes
1answer
201 views

Running async processes in node.js on multiple cores

Using the async and child_process modules, I can create true asynchronous processing. My question is, how can I ensure that it ...
4
votes
2answers
283 views

Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
6
votes
1answer
541 views

Web Scraping with Python + asyncio

I've been working at speeding up my web scraping with the asyncio library. I have a working solution, but am unsure as to how pythonic it is or if I am properly ...
8
votes
3answers
116 views

Asynchronous Code Inspections

Rubberduck code inspections can take quite a while to complete, so I decided to run them on a background thread instead of locking up the IDE. The only drawback is... the IDE isn't locked-up while ...
1
vote
2answers
192 views

Handling errors of nested promises

This is in one of my AngularJS controllers: ...
3
votes
0answers
55 views

Q.js worker pool

I'm building a program to scrape data about hockey games in order to compile statistics. One of the run modes will process all of the games in a single season (1230). Processing a single game consists ...
2
votes
1answer
255 views

C# Async and DataContext access

I'm using a DataContext to insert an object. Currently it's working, but I'm feeling things could be done better. Method is called from UI (Using Caliburn Micro Binding). IsBusy is a property used by ...
4
votes
1answer
508 views

Throttle actions by number per period

I want to throttle asynchronous actions at a specific maximum rate of n actions per t period, and have pending actions wait until there is a free slot (rather than drop them). I want to receive the ...
1
vote
1answer
228 views

Android Movie Class With AsyncTask

I've got a class called Movie and within this class I use an AsyncTask to get a Bitmap from ...
6
votes
1answer
273 views

Calling other machines from the LinkedList if one is blocked or down

This is a follow on to : Simplifying asynchronous "executeAsync" method along with "onFailure" callback. I am using AsyncRestTemplate as my ...
0
votes
2answers
387 views

Uploading a file asynchronously

I've been experimenting with some old code that needs refactoring in places and was testing if there was any improvement to iis threads etc by uploading file asynchronously (Server Side). I'm using ...
0
votes
0answers
65 views

Implementing Ajax deferred/promise patterns

I have a testcase where I want to send a request to the server every time a form field change event occurs. The implementation below works as expected until I ...
3
votes
2answers
93 views

Synchronous and asynchronous motor movement

I am working on an API that is mostly intended to be used interactively/little scripts. There are some classes with methods that could act slightly differently depending on the intention of the user, ...
7
votes
3answers
504 views

Simplifying asynchronous “executeAsync” method along with “onFailure” callback

I have a system in which user id is "sharded" across all the machines which means each machine is responsible for certain user id data. I am working on a library which will take ...