asynchronous

EJB and asynchronous processing

I need to execute some stuff asynchronously after a EJB method is called. This need seems to be fulfilled in EJB 3.1 but unfortunately we're not there yet and have to use 3.0 version. What would you suggest as the simplest way and are there caveats? I can think of the following approaches: JMS (maybe overkill) TimerService (looks sim...

PHP display progress messages on the fly

Hi everyone, I am working in a tool in PHP that processes a lot of data and takes a while to finish. I would like to keep the user updated with what is going on and the current task processed. What is in your opinion the best way to do it? I've got some ideas but can't decide for the most effective one: The old way: execute a small p...

ASP.NET MVC 2 A question about an Asynchronous Controller

Hi, I'm wondering about one thing - let's assume that the user clicks a button, and the asynch controller's action is invoked. What happens, when the asynchronous action takes e.g. 10 seconds? The user has to wait 10 seconds to view the result of the action? If so, are the asynch controllers really helpful ? ...

Multilevel asynchronous method call pattern in c#

Hi, I have design problem regarding async calls to method. I'd like to know best/good pattern to call async method, which calls another async method, which calls another async method :) In other words, I have WCF service reference created with async methods and I want to call them from another async method which is called by other as...

Running IronPython Script in C# Asynchronously

In C# 4.0 and IronPython 2.6, is it possible to execute a python script in it's own thread? I would like to spawn off the script after passing in some event handler objects so that it can update the GUI as it runs. ...

alternative to updating UI from AsyncCallback

Using ASP.NET... In my code-behind, I make an async call (BeginMyMethod) to a web service. In the AsyncCallback method, I call EndMyMethod to get the results. I understand the page by now has totally rendered, so I can't update the UI. Is it possible to update the UI using these Begin/End methods? Is there a different route I could ta...

How to handle asynchronous socket receiving in C++?

I'm currently using a thread to handle Connect and Send calls asynchronously. This is all working fine, but now I want to make receiving asynchronous too. How should I receive data without pausing the whole queue while waiting for data? The only solution I can think of right now is a second thread. ...

Sequential access to asynchronous sockets

I have a server that has several clients C1...Cn to each of which there is a TCP connection established. There are less than 10,000 clients. The message protocol is request/response based, where the server sends a request to a client and then the client sends a response. The server has several threads, T1...Tm, and each of these may se...

F# Async problem.

Hi, I've written a dummy http server as an exercise in F#. I'm using Mono 2.4.4 on Ubuntu 10.04 x86_64, with MonoDevelop. The following code fails to compile with the error: Error FS0039: The field, constructor or member 'Spawn' is not defined (FS0039) Could someone try this in VisualStudio please, I don't know whether this is a Mon...

Workflow Foundation: Asynchronous operations (lengthy network I/O)

I have to create an application that will be started a few times per day (it's non - interactive). To operate, it needs LARGE amounts of data from the Internet (megabytes) via a rather slow connection, so the WCF service calls take quite some time. At the same time, it needs to perform local calculations and has a sophisticated initial...

Async Load JavaScript Files with Callback

Hi All, I am trying to write an ultra simple solution to load a bunch of JS files asynchronously. I have the following script below so far. However the callback is sometimes called when the scripts aren't actually loaded which causes a variable not found error. If I refresh the page sometimes it just works because I guess the files are ...

jQuery-ajax call: async property is not working?

Hi, given to certain circumstances, I'm forced to keep page settings (Javascript-values) in the session and it has to be done right before leaving the page (I can't use cookies, since "pageSettings" can become quite large and localStorage is not an option yet ;) ). So this is how I tried it. However it seems that when I call the page di...

Two questions on ensuring EndInvoke() gets called on a list of IAsyncResult objects

So this question is regarding the .Net IAsyncResult design pattern and the necessity of calling EndInvoke as covered in this question Background I have some code where I'm firing off potentially many asynchronous calls to a particular function and then waiting for all these calls to finish before using EndInvoke() to get back all the r...

Dowloading a bunch of files asynchronous wait till last finished

I'm trying to download a lot of files after downloading a sql statement must insert a record. I'm using System.Net.Client to download each file synchronously, still it could be done asynchronous. There's no relation or dependency between each download. At first I just tried to use WebClient.DownloadFileAsync but that shutted the progr...

What's the best way to cancel an asynchronous WCF request?

(Assuming a WCF method called "MyFunction") Currently, to support canceling a WCF request, I'm using the BeginMyFunction/EndMyFunction methods generated by svcutil (and handling an isCanceled flag when dispatching the results to the main thread). I'd like to use the MyFunctionAsync method (and hooking into MyFunctionAsyncCompleted event...

C# async callback on disposed form

Quick question: One of my forms in my winform app (c#) makes an async call to a WCF service to get some data. If the form happens to close before the callback happens, it crashes with an error about accessing a disposed object. What's the correct way to check/handle this situation? The error happens on the Invoke call to the method to ...

Testing asynchronous methods on iPhone

I tried OCUnit, GTM, and iUnitTest but none of them supports testing for asynchronous methods. How do you test asynchronous methods on iPhone? ...

Can I use a single instance of a delegate to start multiple Asynchronous Requests?

Just wondered if someone could clarify the use of BeginInvoke on an instance of some delegate when you want to make multiple asynchronous calls since the MSDN documentation doesn't really cover/mention this at all. What I want to do is something like the following: MyDelegate d = new MyDelegate(this.TargetMethod); List<IAsyncResult> re...

Practical differences between using TPL and Async Pattern

I am looking into using either of mentioned ways of dealing with long running operations. I won't be going into details what can be accomplished using each of these, but I'd rather explain what I want to do. I have a set of HTTP-related methods, each retrieving a few pieces of information. This is all part of bigger system inside of a ...

Make a heavy page run asynchronously in ASP.NET

Hey, I've created a heavy page that is meant for the site operators. The page takes about 3 minutes to complete, and if we will implement it in production it will get timed out. I don't want to increase the timeout limit of the site or the page itself. I want to make it asynchronously. Note however that the page returns results, theref...