asynchronous

Should I provide Sync or Async methods for developers in my IMDB API library?

I'm going to make a DLL Library that'll alow developers to search and access IMDB movie pages. How should I handle the freezing in the GUI, should I use async methods, or should I allow a dev to manually create a thread for using our DLL? ...

How can I call this webservice asynchronously?

In Visual Studio I created a web service (and checked "generate asynchronous operations") on this URL: http://www.webservicex.com/globalweather.asmx and can get the data out synchronously but what is the syntax for getting the data out asychronously? using System.Windows; using TestConsume2343.ServiceReference1; using System; usin...

What are the implications for Async I/O (BeginWrite/BeginRead) with a chain of streams?

Suppose I have a chain of streams, that does Compression -> Encryption -> File I/O. In C#, using synchronous I/O, it would look something like this: int n=0; byte[] buffer= new byte[2048]; string inputFileName = "input.txt"; string outputFileName = inputFileName + ".compressed.encrypted"; using (FileStream inputFileStream...

jQuery AJAX: collecting multiple asynchronous results

I'm running a validation on form data, such that when somebody hits the submit button it checks the form's contents first. A number of fields (could be zero, could be more than one, depending on the page) have things like unique codes which require checking with the server first. I'm running an asynchronous request to the server, which s...

Callback function is not executed in an asynchronous call

I am trying to make a simple asynchronous call with WCF, but the callback function is never executed. Can anyone tell me what is wrong with the code? I am using visual studio 2008 with .Net 3.5 You can download a visual studio 2008 solution from here: http://dl.getdropbox.com/u/419244/AsyncCalls.zip Service code [ServiceContract] pu...

Downloading HTTP URLs asynchronously in C++

What's a good way to download HTTP URLs (e.g. such as http://0.0.0.0/foo.htm ) in C++ on Linux ? I strongly prefer something asynchronous. My program will have an event loop that repeatedly initiates multiple (very small) downloads and acts on them when they finish (either by polling or being notified somehow). I would rather not have...

What can cause select to block in Python?

Here's a snippet of code I'm using in a loop: while True: print 'loop' rlist, wlist, xlist = select.select(readers, [], [], TIMEOUT) print 'selected' # do stuff At a certain point, select will block and "selected" is never getting printed. What can cause this behavior? Is it possible there's some kind of deadlock? U...

.NET Client/Server Scaleability & Asynchronous I/O - Excess Thread Issues

I have a pretty simple question which perhaps someone familiar with Server/Client design & the Asynchronous I/O paradigm of .NET could answer quickly... I'm writing a server-side application which is designed to run on relatively non-sophisticated hardware (read: not-so-modern, average office desktop PCs), but accommodate a reasonably l...

Easy Python ASync. Precompiler?

Hi, imagine you have an io heavy function like this: def getMd5Sum(path): with open(path) as f: return md5(f.read()).hexdigest() Do you think Python is flexible enough to allow code like this (notice the $): def someGuiCallback(filebutton): ... path = filebutton.getPath() md5sum = $getMd5Sum() showNotifica...

How to ensure order of async operation calls?

[This appears to be a loooong question but I have tried to make it as clear as possible. Please have patience and help me...] I have written a test class which supports an Async operation. That operation does nothing but reports 4 numbers: class AsyncDemoUsingAsyncOperations { AsyncOperation asyncOp; bool isBusy; void Noti...

Converting Asynchronous Programming Model (Begin/End methods) into event-based asynchronous model?

Let's say I have code that uses the Asynchronous Programming Model, i.e. it provides the following methods as a group which can be used synchronously or asynchronously: public MethodResult Operation(<method params>); public IAsyncResult BeginOperation(<method params>, AsyncCallback callback, object state); public MethodResult EndOperat...

Ajax Call inside a each() Loop not being asynchronous

Hi What I'm trying to do involves going through a series of checkboxes. For each one of them that it is checked, I have to perform some calculations (using an ajax call). If there is an error, I have to break the loop and return a message. Every ajax call takes about 0,4 seconds to perform but that shall never be a problem because I c...

UITableView problem with asynchronous image loading

So this is my problem: I have an UITableView with custom UITableViewCells. Each one of the cells have one UIImageView which downloads an remote image using asynchronous image loading. It's working ALMOST perfectly, but I have this weird issue. When the view is loaded I can see the 5 or 6 first cells without scrolling (iPhone's display ...

C# Asynchronous sending

Hello, I've been working with asynchronous sending in C# lately, and just a couple of days ago when i encountered that i needed to send multiple bits of data, i started wondering if the data sent are sent in order. So my question is, when you send data asynchronously in c-sharp, does it send the data accordingly as it's sent? Eg. I se...

Asynchronous queries in a web app, using NHibernate

In a web application, the Session is only available in the current thread. Does anyone have any tips for executing queries through NHibernate in a new asynchronous thread? For example, how could I make something like this work: public void Page_Load() { ThreadPool.QueueUserWorkItem(state => FooBarRepository.Save(new FooBar())); } ...

Why does asynchronous delegate method require calling EndInvoke?

Why does the delegate need to call the EndInvoke before the method fires? If i need to call the EndInvoke (which blocks the thread) then its not really an asynchronous call is it? Here is the code im trying to run. class Program { private delegate void GenerateXmlDelegate(); static void Main(string[] args) ...

asynchronus web services, callback problem

I have a asynchronous web service using axis2 which I call two different times using the same CallBack Hanlder as follows : stub.startGetData("Foo",callbackhandler) stub.startGetData("bar",callbackhanlder) ServiceCallBackhandler callbackhandler = new ServiceCallBackhandler() { .....}; //ServiceCallBackhanlder and stub are generated...

jQuery / javascript question, is a click handler executed asyncronously?

if I have $("a#foo").click(); $("a#bar").click(); dostuff(); and both have click handlers attached which do different things..is it guaranteed that bar's click handler will only execute after foo's completes? or are they dispatched asyncronously similarly..will dostuff() only execute after foo and bar's click handlers complete? ...

Asynchronous address resolution in winsock?

Looking into asynchronous address resolution in winsock it seems that the only two options are either to use the blocking gethostbyname on a seperate thread, or use WSAAsyncGetHostByName. The latter is designed for some reason to work with window messages, instead of overlapped operations and completion ports/routines. Is there any vers...

How to cancel an asynchronous calls?

The title says it all. How to cancel an asynchronous calls? The .NET APM doesn't seem to support this operation. I have the following loop in my code which spawns multiple threads on the ThreadPool. When I click a button on my UI, I would like these threads (or asynchronous calls) to end. foreach (var sku in skus) { loadSku.BeginIn...