asynchronous

Reading an async socket continuously

I have already read other similar question about that problem, but that don't work for me. I'm building an iPhone app that talks with a TCP server (windows, but never mind) and I'm using AsyncSocket from cocoaasyncsocket (googlecode). It's a very useful class, but I can't use that at all. In my code I create a "connector" which I all...

Ways around ActiveRecord connection pool

I'm writing an Adhearsion component that uses ActiveRecord. The problem is that the component may be running for several minutes (the length of a call). During that time the component has an ActiveRecord object as an instance variable. This object uses up one database connection from the connection pool. Depending on the number of caller...

Proper way of getting several scripts asynchronously using Jquery with post-document-ready callback

I'm planning on getting several JS files from my server asynchronously while the page loads. I am aware of the Jquery function "getScript", but this only gets 1 script. Is there any way of specifying a callback to be executed when a batch of scripts have been fetched from the server? I thought about doing something like this: $.getScr...

How can I do a simple asynchronous query implementation in JQuery

Is there a simple tutorial for this somewhere? Ideally I'd like to have a textbox and a button, and when the user clicks the button, the textbox is sent to the server, which returns a value based on it. The client then populates another textbox with the return value, but all without refreshing the page. If it's possible, showing/hidin...

WCF (C#), calling an Async method. help!

Hi, I'm stumped with this and would appreciate any help at all! I'm calling the Amazon api using WCF and the Visual Studio generated -asynch- methods. There's a WPF page, with a button on. Press the button and it calls the search method in another class. (see code below) In this other searcher class, I add the method AmazonItemSearch...

How do I do a non-blocking read from a pipe in Perl?

I have a program which is calling another program and processing the child's output, ie: my $pid = open($handle, "$commandPath $options |"); Now I've tried a couple different ways to read from the handle without blocking with little or no success. I found related questions: perl-win32-how-to-do-a-non-blocking-read-of-a-filehandle-f...

Using blocking REST requests to implement publish/subscribe

I've recently been asked to investigate the feasibility of integrating with a phone system vendor who wants to make phone events (e.g. line ringing, extension answered, call cleared) available using a RESTful web service. I pointed out that REST is a request/response protocol and they were doing publish/subscribe. The solution they were...

c++ win32: executing a method on ui thread due to an event on background thread

I've got a background thread that is polling a server. When there's data, i want to handle the data on the ui thread. If I store the hwnd of the main window. How can I get a particular method -- static void DataHandler(void* data) to be executed on the ui thread. I think creating a timer passing the hwnd and the function pointer w...

Providing a timeout value when using @Async for a method using Spring 3.0

I looked through the documentation but couldn't find if there is a way to specify a timeout for async operations spawned when using @Async annotated methods using Spring 3.0. Is there a way to do that? I think this is pretty essential whenever making triggering an async computation. ...

Perform several tasks synchronously in Android

I don't know how to elegantly solve the following task: I have several blocks of code (operation) to execute. Each block can return true of false to indicate that further execution is possible. Inside of each block I have to use asyncronous methods calls (Because Android is completeley asynchronous). Example of processing operations...

Weld - Asynchronous Event Observers

Hi all, I am using Weld to observe events. I thought there was a way to specify if the observer was asynchronous or not, but I am not finding that annotation or documentation. Can observers be asynchronous, if so, what do I need to do to make that happen? Thanks, Walter ...

Creating a thread to asynchronously download xml for usage in UI elements

I'm making an application that grabs an RSSFeed from one location, parses it, and displays the items in a rich ListView. I've got it working synchronously, but it hangs on the initial download. I used ImageDownloader from the Google blog to asynchronously grab images to populate the ListView, but how do I go about threading the download ...

Threaded web service call

I am requesting information from a web service in my android app. The web service returns a list of items, each item having a base64 image and some info First method: simply access the web service and get the result. This means freeze of UI until data is downloaded. Not a good solution Second method: put the data download in a thread, ...

Build the request to call WebMethods inside .aspx in c#.

Hi. I have a WebMethod inside an .aspx: [WebMethod()] [ScriptMethod(ResponseFormat = ResponseFormat.Xml)] public static XmlDocument GetSomeInformation() { XmlDocument Document = new XmlDocument() // Fill the XmlDocument return Document; } It works great when i call it with JQuery: TryWebMethod = function() { ...

Asynchronous programs showing locality of reference?

I was reading this excellent article which gives an introduction to Asynchronous programming here http://krondo.com/blog/?p=1209 and I came across the following line which I find hard to understand. Since there is no actual parallelism(in asnyc), it appears from our diagrams that an asynchronous program will take just as long to execut...

Using Rx to simplify an asynchronous Silverlight web service request

I have written a simplified Silverlight client library for my WCF web service using Rx, however I notice sometimes I'm missing completed events. public IObservable<XElement> GetReport(string reportName) { return from client in Observable.Return(new WebServiceClient()) from request in Observable.ToAsync<string>(client.Get...

uploading records of list of files in parallel using pyton to DB

I have a list of files each file have mass of records separting by \n , i need to proccess those records in parallel and upload them to some sql server could someone provide an idea what is the best way to do this with python ...

How do you implement a reusable named pipe listener that runs asynchronously?

I can't find a good example of how to create a reusable named pipe listener that runs asynchronously. I can make a reusable listener: NamedPipeServerStream pipeServer = new NamedPipeServerStream("MyPipe", PipeDirection.InOut); while (true) { pipeServer.WaitForConnection(); StreamReader reader = new Stre...

TimeoutException on AsyncController in HyperV environment

We are getting a TimeoutException on an MVC AsyncController in our Beta HyperV environment. Everything works fine when debugging locally, but when we deploy to the pre-production environment, we get this error: [TimeoutException: The operation has timed out.] System.Web.Mvc.Async.WrappedAsyncResult`1.End() +129 System.Web.Mvc.Asyn...

Modifying on the fly the data sent with jquery via ajax

Hi, I am using the jQuery.ajax() with some specific data. One of them is an albumid which is generated on the server side if the user choose not to use one of his albums. The problem is that if a user add several photos to a new album then, instead of adding all photos to the same album, it creates several albums with one photo in each. ...