This covers the asynchronous programming model supported by various programming languages, using the async and await keywords.
7
votes
1answer
140 views
Async TCP client/server
I'm working on a simple async TCP client server application, i'd like my network code to be reviewed. I really feel that I'm doing something wrong, especially in receiving code.
Interface for client:
...
3
votes
1answer
52 views
A Switch for async function invocations
I have implemented a simple "switch" function - that switches and invokes an alternate function, if the function that is to be invoked fails or timesout.
This code will be later employed as part of ...
4
votes
1answer
65 views
Task-Based Overlapped IO In .NET
I've been working wrapping the Windows API's Overlapped methods in the more usable Task based approach. There isn't much information out there on doing this, so I've been flying blind apart from a few ...
2
votes
1answer
62 views
WPF - Run an async Task with DispatcherTimer
I have a small application that checks some system status and display it details.
I have the following code which is working. But I want to make sure it's optimal:
...
5
votes
1answer
96 views
Use of Async/Await for EventHandlers
I have a MVC WinForms application. I am using Dependency Injection with Ninject as the IoC container.
...
1
vote
1answer
58 views
Performance of an OLX crawler
I'm learning concurrency and asynchronous programming in C#. For a better grasp on the matter I'm trying to create an OLX Crawler. My issue here is the performance: It takes roughly 159 minutes to ...
3
votes
2answers
80 views
TPL Async Await in Console Apps
I just picked up Async Await and I am trying to use Async Await in Console App along with TPL for querying webservices. The code works fine and I am able to get the speed using HttpClient and async. ...
1
vote
2answers
144 views
Parallel process interest in C#
In web api controller:
I am a newer in parallel and Async&Task programming. Need someone help me code review.
...
4
votes
0answers
163 views
Socket application using TPL
This is an application I wrote that allows multiple TCP clients to share a single TCP connection to a remote server (hosted project, and a demo). Traffic generated by the server is forwarded to all ...
-1
votes
1answer
166 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
1answer
277 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 ...
6
votes
1answer
95 views
Enumerating smart card terminals asynchronously in ViewModel constructor
I started a project the other day and started going down the path of using async and await as I have never used it before and it seems like a good match. The app that I'm making is a WPF solution ...
1
vote
2answers
86 views
Processing files retrieved through FTP in parallel
I am busy creating a file processor that needs to get some files from an Ftp client download the file and save the data into the database. I have a two part question.
How can i refactor the code to ...
1
vote
2answers
97 views
Asynchronous lookup over HTTP and checking the status
For some reason declaring ApiResult before checking if the answer is in a correct status doesn't look good. I wonder if there is any better way to check the status ...
1
vote
1answer
103 views
Safe async API code
I'm pretty new to async/await and I want to ensure that the code I've written is going to be safe and not cause any deadlocks.
The RestClient in the code will be ...
3
votes
2answers
56 views
Going to the thread pool and back using custom awaiters
I've figured out a way to switch threads in the middle of a method. The benefit of that seems super obvious to me: that's what everyone wants to do anyway, and splitting up methods, using callbacks, ...
5
votes
3answers
121 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 ...
2
votes
1answer
148 views
Buffered asynchronous writer
Imagine I have connection in which I have to write numbers, represented by this contract:
...
6
votes
2answers
71 views
Cancellable UI loader
I'm playing with async/await, but I have yet to discover a standard method to safely cancel an intensive task. I have tested the following, and it works exactly as intended, though I remain unsure if ...
0
votes
1answer
1k views
Starting a fire and forget async method
Sonar/FxCop are telling us that we shouldn't use void async methods. That's ok.
This is the current implementation:
...
6
votes
1answer
227 views
Embedding an RSS feed into a page after it's already loaded
I'm working on reworking our website from a WYSIWYG editor to MVC. I'm all right with server side code, but complete rubbish when it comes to client side Javascript, so I'd appreciate any/all feedback....
1
vote
1answer
27 views
Socket.ReadPacketASync
I'm working with TCP Sockets and I've build a simple packet struct that turns it into a datagram protocol. I've created a class which returns "promise" Tasks for Packets. Packets are very simple, they ...
4
votes
1answer
93 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 ...
0
votes
1answer
61 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?
...
6
votes
1answer
173 views
Priorizatable command queue
This code consistently executes commands with a given priority. How can I to improve it?
...
3
votes
2answers
122 views
Mapping a user input string to a corresponding block of code
My idea is I can define a block of code (inline) that corresponds to an input string then can call that block of code when given that input.
I'm used to this sort ...
1
vote
1answer
82 views
JavaFX await implementation
I'm debating trying to take a crack at getting something similar to C#'s async-co-routine like nature over on JavaFX.
This is technically feasible since the Quantem toolkit exposes the ...
11
votes
3answers
349 views
Async insecurities
I feel like I'm overdoing the async await stuff. I'm just learning. Maybe this isn't the best instance to be using this stuff.
I have a system with sensors that detect the completion of some action....
19
votes
2answers
243 views
RubberduckParser 2.0 - Asynchronous Parsing
The IRubberduckParser interface has seen breaking changes, and now looks like this:
...
0
votes
2answers
256 views
Async - await all the way
Related to this question (and even this Stack Overflow's one) I have been trying to avoid blocking the code. So what I understood it's that is preferable to make all the methods that rely on an async ...
1
vote
1answer
78 views
Change implementation from getting json from file to get it from API
I used to get a JSON file with some configuration settings from the file system, using this class:
...
1
vote
2answers
133 views
Running tasks in parallel
I've just started writing asynchronous methods for the first time having watched some tutorials.
I have a method where I run two tasks in parallel (...
7
votes
1answer
239 views
Async Yield and continue on TaskPool
Using await task.ConfigureAwait(false) is a standard best practice for indicating to the compiler that the continuation does not need to be run on the current ...
0
votes
1answer
87 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 ...
0
votes
1answer
33 views
JW Player + Brightcove Integration
The following code gets video renditions from Brightcove using the media API. It then generates an ordered source list for the JW Player and selects the default rendition based on a pre-set bitrate.
<...
1
vote
1answer
215 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
1answer
72 views
Await state async
For speed we sometimes return response to consumer before state is saved in DB. Sometimes (Mostly for our automated consumers) this can break because the want to make actions on the saved data before ...
5
votes
1answer
186 views
Async access to School
I have this class with two public async methods, which also calls some private methods that are async.
Here's the class:
...
5
votes
1answer
542 views
Implementation Async/Await
I have a simple ASP.NET Web API project. Now I want to make all basic methods as asynchronous. I tried to do something, and it's working but I'm not sure that it was implemented properly.
Please ...
1
vote
2answers
551 views
UI error display window with task async in WPF
I am new to async and was wondering if any improvement can be made to the solution I put together from scattered information on the web.
The following (working) code shows how a button press runs ...
1
vote
1answer
557 views
Windows Service listening for messages from a network
I am new with async task in C# 4.5 and feel insecure about this:
I want to create a Windows Service that listen messages from a network (similar to msmq for example), when a message is received, do ...
2
votes
0answers
115 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:
...
2
votes
1answer
419 views
Downloading data using HttpClient
I'm working on a class to download some data from an external server and feed it into my data model. I'm new to both HttpClient and ...
8
votes
1answer
144 views
Looping until browser document is ready
I made a do...while loop in order to wait for the web browser to load completely in order to enter username and password. I don't know whether this impacts the ...
2
votes
1answer
2k 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 ...
4
votes
2answers
289 views
Async & ContinueWith
I am implementing my own UnitOfWork for an EntityFramework-DataContext.
I want to call ...
3
votes
3answers
410 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 ...
2
votes
2answers
164 views
Class for easier to read IProgress<Class> handling (Version 2.0)
This is an update to my question Class for easier to read IProgress handling and includes the suggestions from @svick, with one exception.
It was also suggested to change the setter for ...
2
votes
1answer
1k views
Cancellable progress form using async/await
Introduction:
For a project I'm working on I used a BackGroundWorker to lift some heavy tasks away from the UI thread and report progress. For this I created some ...
4
votes
1answer
237 views
Calling common async code from a derived method
I'm implementing a number of classes in C# that have async methods. However, each of these methods needs to implement some boilerplate code that is common to all. Therefore I've implemented the common ...