asynchronous

Custom Windows Workflow activity that executes an asynchronous operation - redone using generic service

I am writing a custom Windows Workflow Foundation activity, that starts some process asynchronously, and then should wake up when an async event arrives. All the samples I’ve found (e.g. this one by Kirk Evans) involve a custom workflow service, that does most of the work, and then posts an event to the activity-created queue. The main...

Multithreading and concurency with C#

In a Windows Form window, multiple events can trigger an asynchronous method. This method downloads a file and caches it. My problem is that I want that method to be executed once. In other words, I want to prevent the file to be downloaded multiple times. If the method downloading the file is triggered twice, I want the second call to...

Is there a way to get error feedback on asynchronous WCF calls?

Hi, I have a WCF service which works 100% in the synchronous (blocking) mode and I now need to rework a call so that it uses the async pattern. The service uses authentication and performs a chunked file transfer from client to server so I have reworked it to use the 'Begin' async prefix to kick off the call. Now I'm testing for error...

C non-blocking keyboard input

I'm trying to write a program in C (on linux) that loops until the user presses a key, but shouldn't require a keypress to continue each loop. Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work. Alternatively, is there a way to catch a control-c keypress to do cleanup befor...

How to correctly use .NET2.0 serial port .BaseStream for async operation

I am attempting to use the .BaseStream property of the .NET2.0 SerialPort to do asynchronous reads and writes (BeginWrite/EndWrite, BeginRead/EndRead). I am having some success in this, but after a time, I notice (using Process Explorer) a very gradual increase in the Handles the app is using, and occasionally an extra thread, which als...

Matching web service results to requests in Flex

A little (!) bit of background before I can get to the question : I have an accordion control loaded with an array of grids, each of which is lazy loaded with arrays of things. I'm using an auto-generated web service proxy to retrieve these lists. I'd like for the user to be able to change the selected child in the accordion without hav...

process.WaitForExit() asynchronously

I want to wait for a process to finish, but process.WaitForExit() hangs my GUI. Is there an event-based way, or do I need to spawn a thread to block until exit, then delegate the event myself? ...

In .NET, Streaming data from SQL to a file

I have to get a DataTable from SQL, and then convert it to XML (I can't use SQL XML) and save to a file. The problem is that the file is going to be 5 GB, and I don't have enough memory to download it all and convert it to XML all at once in memory. I know I should be able to use a DataReader to convert and push the data to the file st...

Wrapping an asynchronous method synchronously in C#

I have a third party library containing a class which performs a function asynchronously. The class inherits from the Form. The function basically performs a calculation based on data stored in a database. Once it has finished, it calls a _Complete event in the calling form. What I would like to do is call the function synchronously but...

Errors when trying to use HttpWebRequest in Silverlight 2

Im trying to write to a form from an asynchronous call. The examples I seen on line show that this should work but I keep getting an error. First the call that is made though the Disbatcher never calls p. Second i get a System.Security.SecurityException on the call req.EndGetResponse(a); What could be causing the problem? public parti...

Using the CCR with ASynchronous WCF Service

I'm learning how to use the CCR (Concurrency and Coordination Runtime) in conjunction with a Asynchronous WCF Web Service. This is the Test WCF Service: public class Service : IService { private Accounts.Manager accountManager = new Accounts.Manager(); public IAsyncResult BeginGetAccount(int id, AsyncCallback ca...

Async Workflows in F#

I am a C# programmer, but I have a question about Async Workflows in F#. Supposing I have the following class in a C# class library: class File { IAsyncResult BeginReadAll(string fileName, AsyncCallback callback, object state){} string EndReadAll(IAsyncResult result){} } My understanding is that is possible in F# for me to make a f...

Can LINQ-To-SQL be used Asynchronously?

Can LINQ-To-SQL be used Asynchronously? Are there any OR Mappers that allow Asynchronous operations? CLOSED: See http://stackoverflow.com/questions/252355/how-to-write-asynchronous-linq-query ...

How bad is this pattern?

I've been using this pattern when I need to control how long various async operations take. I don't mean specifically for WebRequest (I know you can set the timeout property), I just used this as an example for the pattern. var request = WebRequest.Create(someUri); WebResponse response = null; request.BeginGetRe...

Letting something happen at a certain time with Rails

Like with browser games. User constructs building, and a timer is set for a specific date/time to finish the construction and spawn the building. I imagined having something like a deamon, but how would that work? To me it seems that spinning + polling is not the way to go. I looked at async_observer, but is that a good fit for somethin...

[F#] Best practices to parallelize using async workflow

Lets say I wanted to scrape a webpage, and extract some data. I'd most likely write something like this: let getAllHyperlinks(url:string) = async { let req = WebRequest.Create(url) let! rsp = req.GetResponseAsync() use stream = rsp.GetResponseStream() // depends on rsp use reader =...

.NET Remoting - How can the Server update the client?

Right now, I am in prototyping phase. So I am just getting started. Situation: Server - Will be run tests and publish progress to Client, must be low impact, no webserver, possibly running xp embedded or xp home. Client - Initiate tests and receive progress report. running xp pro. The two machines are connected via ethernet. I wou...

What is your favourite asychronous pattern?

I'm currently trying to get my head around the CCR as a Asynchronous programming model. In the past i've used the standard begin/end methods. I primary develop in VB.net and have been looking with longing at the Yield/Enumerator tricks. What is your favourite asychronous pattern? ...

Asynchronous processing in Java from a servlet

I currently have a tomcat container -- servlet running on it listening for requests. I need the result of an HTTP request to be a submission to a job queue which will then be processed asynchronously. I want each "job" to be persisted in a row in a DB for tracking and for recovery in case of failure. I've been doing a lot of reading. Her...

Do any OR Mappers provide Asynchronous Methods?

Do any .Net O/R (object/Relational) Mappers provide Asynchronous methods out of the box? I don't want to have to write the boiler plate for the asynchronous method if possible I have rolled my own DAL with Asynchronous methods using the CCR framework. The CCR basically demands that I don't block any of it's threads waiting for IO respo...