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.
0
votes
0answers
24 views
Android network api request
I often use a similar scheme work with api project. Maybe it can be made easier, or is there a standard approach?
This class who create api request.
...
-1
votes
1answer
29 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
108 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
1answer
28 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
52 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:
...
1
vote
0answers
30 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
32 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
45 views
Async Implementation
I'm seeking code review comments for the following implementation.
jsFiddle
...
0
votes
1answer
42 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
109 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
124 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
493 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
64 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
124 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 ...
4
votes
0answers
48 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
137 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
53 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
168 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
52 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
40 views
3
votes
2answers
132 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.
...
6
votes
0answers
130 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
43 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
43 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
35 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 ...
2
votes
1answer
54 views
An asynchronous service to produce a results cache for a list of items
What I've created is a CacheBuilder service that will be passed in a list of items, and will build a results cache. The results are produced by making calls to ...
2
votes
1answer
136 views
User registration factory for AngularJS + Firebase app
The goal for this code is to provide a semi-secure and privileged method of user registration via a secret code that is stored as a key in the Firebase database.
Subscribers to a mailing list were ...
3
votes
1answer
125 views
Closing SQL connection for async operations
The following code executes asynchron on the SQL database. Is the closing of the connection implemented in the right way? Are there any missing features regarding connection handling which need to be ...
3
votes
0answers
54 views
Basic Server/Client Model built around ASIO
For this project, I'm using the non-Boost version of the ASIO library.
The basic idea is that it is a relatively simple stand-alone class capable of functioning either as a server or client depending ...
5
votes
3answers
106 views
ToPaginatedListAsync<T>
I'm using this method and I would likely have a code review. Also, I have one concern and is that source.Count() is executing synchronously and I don't know how to ...
4
votes
1answer
57 views
Controller for a vehicle servicing AJAX app
I am working on a codebase that operates in the following manner:
...
2
votes
1answer
90 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
34 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
118 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
52 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-...
2
votes
1answer
53 views
Loading images in the background for a table view
I have fetchData method which fills my imagesArray:
...
1
vote
3answers
248 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
208 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
90 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
131 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
132 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:
...
18
votes
3answers
475 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
69 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
271 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
60 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
256 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
223 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
82 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
84 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
71 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 ...