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

learn more… | top users | synonyms

-1
votes
0answers
33 views

Starting async/await from any arbitrary (synchronous) method [on hold]

If I have a regular method call and I need to 'start' using async/await, what is best way to initiate that? Without going into too much detail, I'm using Hangfire to process jobs and due to some ...
-1
votes
0answers
31 views

Asynchronous programming in c# [on hold]

I am trying to understand the basics of Asynchronous programming and below are my understanding: It is a way of performing unblocking calls for the methods. for example if some operation is taking ...
3
votes
0answers
76 views

Minimal Async Web Server in Rebol 2

I'm building a rudimentary web server in Rebol 2. I'm trying in particular to understand the flow and logic behind the asynchronous aspects of the TCP scheme. As far as I can understand it, you ...
3
votes
2answers
205 views

Scraping HTML via async controller & classes + HTML agility pack

I've developed a simple application to grab golfer index scores from a website that has no API. The application works but is very slow, with 6 users that require updating takes 60 seconds. I've tried ...
6
votes
1answer
79 views

Display Loading Text with Spinner in Console

Here is my approach to creating a loading text spinner in the console. I did what I thought was best in designing the class, which means there is probably a lot of room for feedback. The class is ...
1
vote
1answer
24 views

MUD Telnet game

I'm new in JS and my daily job is PHP, so I decided to do simple MUD Telnet game to practice my JS skills. The idea was to use async/await to do Telnet server code that seems synchronous at first ...
1
vote
0answers
36 views

Indefinite loop in a coroutine vs. re-scheduling a coroutine

I recently started working with asyncio and coroutines. I have a coroutine that runs every 0.25 seconds to print "running ..." on screen indefinitely. When the script receives a SIGTERM or SIGINT it ...
0
votes
1answer
123 views

WPF async ObservableTaskQueue class

I'm currently working on a WPF application, making calls to various web APIs. Thus, I'm looking after a special observable tasks queue: Progress value must be available Tasks (API calls)/seconds must ...
2
votes
0answers
24 views

Parallel and Sequential array looping with async/await

Are these good implementations of parallel and sequential "extension" methods, and do they accomplish what I think they do? My understanding is that the first one is parallel because the await ...
3
votes
1answer
109 views

Try again, and again, and again… but not too often because the potatoes won't grow

The delay sequence has been fixed so I can move to the next step which are the Retry and Breaker. (Just ignore the console ...
2
votes
1answer
100 views

Ensuring no race conditions in my concurrent/parallel ForEachAsync method

Hopefully the final chapter of my ForEachAsync code review. The original question was the starting point and the second question contained modifications suggested ...
6
votes
3answers
517 views

Downloading blobs asynchronously

We have a working implementation that is doing I/O operations, returning data from blobs in an async/await manner from Azure Blob Storage. ...
2
votes
1answer
100 views

Concurrent/parallel ForEachAsync - proper handling of exceptions and cancellations

I've created an asynchronous parallel ForEach mechanism so I could enumerate an enumerable by N degrees of concurrency and process an action for each item. ...
2
votes
1answer
87 views

Creating a concurrent/parallel ForEachAsync that can fail immediately or wait until enumeration is complete

I needed an asynchronous parallel ForEach mechanism so I could enumerate an enumerable by N degrees of concurrency and process an action for each item. Searching ...
2
votes
0answers
54 views

Establishing a TCP connection with async & await

I'm not really super experienced async/await and working with tasks, so I thought I'd ask for some other opinions. I'm working with code written by someone else that establishes a TCP connection. It ...
6
votes
3answers
115 views

Visitor Pattern/Leaky Bucket variant implementation to run an operation at a certain interval

My code is a variant on the Visitor Pattern and a "leaky bucket" variant. The goal is pretty straightforward: the "bucket" will collect a specified number of items (say, for example, 500) and then ...
-1
votes
1answer
47 views

Download Images as fast as possible (task-based update) [closed]

Based on the excellent advice of some users here, I updated my code to do a task based implementation of my previously thread based implementation. This didn't work out of the gate, but I think it has ...
5
votes
1answer
820 views

Download Images as fast as possible

I have a spreed sheet and its something like 550+ columns and I need to pull URLs from it. Previously I was using LinqToExcel when the sheet was less than 255 columns a recent update has produced this ...
2
votes
0answers
94 views

Multithreaded download of images from a spreadsheet

I've been wanting to go async with my HTTP calls but all the methods I tried have not worked, so I resolved to implement this as a task and then improve upon it. This is what I've come up with so far....
3
votes
1answer
141 views

Client/Server, Asynchronous ping-pong exchange

I'm mainly wondering about whether or not I have used the (TAP) async/await pattern correctly. I get a bunch of these warnings, "Because this call is not awaited, execution of the current method ...
1
vote
1answer
93 views

Lazy Init if the Items property is null

I was refactoring a quite large WPF project and I found some pieces of code where it can leads to error. Ive got some services in the form ...
7
votes
1answer
478 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
72 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
132 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
540 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
773 views

Use of Async/Await for EventHandlers

I have a MVC WinForms application. I am using Dependency Injection with Ninject as the IoC container. ...
2
votes
1answer
94 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
184 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
320 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
496 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
328 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! ...
2
votes
1answer
1k 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
102 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
112 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
123 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
237 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
78 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, ...
6
votes
3answers
276 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
251 views

Buffered asynchronous writer

Imagine I have connection in which I have to write numbers, represented by this contract: ...
7
votes
2answers
75 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 ...
1
vote
1answer
3k 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
366 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
38 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
131 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
65 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
273 views

Priorizatable command queue

This code consistently executes commands with a given priority. How can I to improve it? ...
3
votes
2answers
184 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
114 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
356 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
253 views

RubberduckParser 2.0 - Asynchronous Parsing

The IRubberduckParser interface has seen breaking changes, and now looks like this: ...