This covers the asynchronous programming model supported by various programming languages, using the async and await keywords.

learn more… | top users | synonyms

1
vote
0answers
28 views

Aync await TCP Server for concurrent connection [closed]

I have to write asynchronous TCP Server on to which multiple GPS Devices will be connecting simultaneously (Count :- 1000 Approx) and will push some data of size less than 1 Kb on server, In the ...
1
vote
1answer
78 views

Buffered asynchronous writer

Imagine I have connection in which I have to write numbers, represented by this contract: ...
0
votes
0answers
21 views

Can this implementation heavily harm write performance? [closed]

For some reason I need to reimplement a method of this interface: Task Save(ISagaData sagaData, Dictionary<string, string> sagaAuditMetadata); This is the ...
6
votes
1answer
52 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
81 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
126 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 ...
1
vote
1answer
16 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
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 ...
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? ...
6
votes
1answer
128 views

Priorizatable command queue

This code consistently executes commands with a given priority. How can I to improve it? ...
3
votes
2answers
72 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
51 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
338 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 ...
18
votes
2answers
223 views

RubberduckParser 2.0 - Asynchronous Parsing

The IRubberduckParser interface has seen breaking changes, and now looks like this: ...
0
votes
2answers
100 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
60 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
114 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
191 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
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 ...
0
votes
1answer
19 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
104 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
67 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
136 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
250 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
249 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
228 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
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: ...
2
votes
1answer
190 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
132 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
946 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
203 views

Async & ContinueWith

I am implementing my own UnitOfWork for an EntityFramework-DataContext. I want to call ...
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 ...
2
votes
2answers
159 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
643 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
164 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 ...
5
votes
1answer
2k views

Async SerialPort Wrapper

I've been working with the SerialPort class for a while, trying to figure out the best way to work with it, and especially adding support for Async-Await in C#. I ...
2
votes
1answer
219 views

Listening for several connections in an async method

Is there a better way to structure a method that returns a task that queues several inbound socket connections? ...
3
votes
1answer
717 views

Controlling a Windows Service from a WPF app

I have a WPF Control Panel app, where I'm trying to stay close to an MVVM architecture. The control panel (the "the CP") is for a WCF service ("the Scheduler"), hosted in a Windows Service ("the ...
3
votes
1answer
93 views

Finding a customer's gender

I have been playing with Async/parallel execution in entity framework for while. I'm not sure if I'm doing it right. I have two entity contexts: one for reading and one for writing. The reading ...
7
votes
3answers
181 views

Notifying the UI that Issues Were Found

Our Rubberduck VBA IDE Add In does some static code analysis, and then reports all of the found issues back in a gridview. This analysis can take a long time for larger projects and the UI appeared to ...
3
votes
1answer
291 views

Is this pattern of Task queueing acceptable?

The AsyncWorkerQueue class uses TPL Data Flow and Rx to async process and cancel work in a queue. It takes in a worker factory (Func) and executes it when its turn (or not if its scheduled to be ...
8
votes
2answers
628 views

Quicksort async vs serial

I am playing with async and I figured I'd write a parallel implementation of Quicksort while trying to look at various optimizations. I want to keep the generics ...
5
votes
2answers
94 views

Forced Async operation in a (event like) method

I have a piece of code that I am not feeling comfortable. I don't want to block the UI Read operation works synchronously (reading may broke 50 ms rule) Save operation supports async (returns ...
2
votes
1answer
185 views

A utility class for running up to two Tasks serially, where the last task to be queued “wins”

Edit: Use cases for this class - I needed this class in the case where I had processes I needed to execute (in the form of tasks - they were all asynchronous) that I needed to issue to a UI control ...
3
votes
1answer
247 views

Using list of tasks to obtain and cache data

I develop Windows Phone App with Prism framework (MVVM). I use data caching. To get data I use proxy service. Proxy service creates two ...
3
votes
1answer
306 views

Wait for System.IO.StreamReader.ReadLineAsync

I want to wait for a line to be read, but only for so long before timing out. This is what I came up with. Is there a better way to do it? ...
35
votes
3answers
3k views

Simon Says: “Make me a pretty game”

In Memoriam Ralph H. Baer, co-inventor of the original "Simon" game, died Saturday December 6th 2014, at 92. With his passing, this friendly little challenge inadvertently became a memorial to ...
4
votes
1answer
2k views

Asynchronously wait for a task to complete and do some async action while waiting

I have a long-running task. My goal is to create a method that will allow me to: Asynchronously wait for this task to complete While waiting on a task, do some async action once in a while. This ...
3
votes
1answer
690 views

Asynchronous task and close sql connection

The following code compiles correctly: ...
4
votes
1answer
220 views

Compressing a stream asynchronously, and returning a byte[]

Assuming I have to leave the contract intact (take byte[] and return byte[]), what's the correct way to structure this ...