asynchronous

Wait for any event of multiple events simultaneously in F#

In F# I know how to wait asynchronously for one event using Async.AwaitEvent: let test = async { let! move = Async.AwaitEvent(form.MouseMove) ...handle move... } Suppose I want to wait for either the MouseMove or the KeyDown event. I'd like to have something like this: let! moveOrKeyDown = Async.AwaitEvent(form.MouseMove, form.Ke...

Asynchronous, timed function calling in C on Linux?

What is the easiest, most effective way in C on Linux to asynchronously call a function after a certain delay (like JavaScript's setTimeout) or set a repetitive timer call it periodically (similar to setInterval)? Though this question applies to Linux, I hope there is a method that is cross-platform. ...

Asynchronous threads in standard C++

Hi, I wonder how could I implement an asynchronous call in standard C++. I have a image/video processing program and I want to add another function/feature but I would like it to be run in a another thread or to be run asynchronously to the original thread. I just want to notify the main thread when something happened in this new threa...

Classic ASP or ASP.NET : make multiple async calls, return when all complete

I need to gather information (via GET) from several other websites (not under my control), do some processing (specific to each source) on the data returned, and then print all the info out to the user. Right now I'm making the GET request to website A, waiting for it to return, processing it, then calling website B, and so on... Obviou...

Using .Net Parallel Extensions (Parallel.Invoke) for multiple asynchronous calls?

Currently I have a section of code that needs to make about 7 web service calls to various providers for data. Each call takes a several seconds to execute, so I would like to run them in parallel to speed things up. I have wrapped my 7 calls in a Parallel.Invoke which works great at running a couple things at the same time, but on a 2 ...

nodejs/express testing

im writing an app with express. main file is called server.js one of the objects is var app = express.createServer(express.logger(), express.bodyDecoder()); then i have app.get("/",function(req, res){ res.send("Running"); } how do i use expresso, [or any other testing framework for that matter], to test the routes output? I looked a...

Asynchronous call C#.Net beginners question.

So here I am,got some help from some web tutorials and performing following Asynchronous call. I want to return an object of type UserInfo from following async call. But I'm not sure how the program flows after request.BeginResponse(). Is it something like an additional ref parameter of type UserInfo can be passed to callback method? ...

How an Asynchronous call communicate to UI

A Windows Phone application referencing a dll(another class library project). There is an asynchronous webrequest in the dll to request a server and parse the response. Click event of a button in the main page of WinPhone application calls the asynchronous method of referenced dll.The callback method raises an event when the response is...

Sockets and threads using C.

I am new to both sockets and threads. I have this code: listen(socket_fd, 20); /* Looooop */ while (1) { newsocket_fd = accept(socket_fd, (struct sockaddr *) &client_addr, &client_len); if (newsocket_fd < 0) { error("ERROR on accept"); } pthread_t thread; ...

Access denied when using AnonymousPipeStreams within a single process

I need to have an anonymous pipe within the same process to allow stream based async communication between two libraries. Everything works until I call the Stream.Read() - I get a UnauthorizedAccessException - Access to the path is denied. Any ideas? using (var pipeServer = new AnonymousPipeServerStream(PipeDirection.Out)) using (var p...

Possible memory leak in Asynchronous ASP.NET Call to a WebService?

I've created a small class library to asynchronously call a WebService(Fire and Forget. I don't need the result). In a Windows Form application, the XXXAsync() method works fine. But, in a Web Application, the process is locked until the XXXCompleted event is fire. My problem is: I tried to create a Delegate and use the Begin/EndInvok...

Best way for a Flash client to talk to a Java server through a full-duplex connection (chat or game)

My client is in Flash/Flex (game with chat) and it will be talking to a Java server. What is the best way (protocol / interface) for my Flash client to talk to my server? I heard about Flash Remoting MX, but it is a request / response mechanism. I could always request something and wait for asynchronous notifications from server. Then re...

Does an asynchronous call require an extra thread in the current process or use another thread in a thread pool?

I'm referring to this answer where it says it's not required, there are few specific assumptions though. That question is general. I'm using C# Asynchronous process is doing nothing but just calling an external API and waiting for the reply. ...

How to update asynchron pages upon event from other client?

Hey there, I'm currently fooling around with AJAX. Right now, I created a Markdown previewer that updates on change of a textarea. (I guess you know that from somewhere... ;-) ). Now, I'm trying to figure out, how to update a page upon an event is fired from another client. So to say an asynchron message board. A user writes something,...

How to call a method/selector when a variable/object changes value on iPhone

Hi, I'm looking for a way to "monitor/observe" a singleton class I'm using to pass information back from an asynchronous http request. I want to update the UI once I have received and parsed the response. Since iPhone SDK does not have an NSArrayController to monitor my data in the singleton, how can I do an asynchronous UI update? Thi...

Change ImageView after few seconds

Hi all, I'm trying to implement a simple activity that will let user to insert a password. I've a gridview with the 9 images to use and 4 imageviews that will be the selected images (on clicking on item on gridview, the corresponding image will be filled with the selected one). Now the problem: I want that the 4 imageviews acts similar ...

Rails background/async task requirement

We have a rails v2.3.8/apache/passenger application & have async requirements for some long running tasks. So I have been evaluating some solutions around rails/ruby, wanted to get feed back on some of the solutions. Also I had one question - on how do the background tasks/workers get spawned. Given our rails app will run inside a apach...

asynchronous threads and anonymous delegates

Ok, now I can use 2 techniques to launch my threads: Dispatcher and BackgroundWorker. Dispatcher: ' I launch the asynchronous process Dim a As New Action(AddressOf operazioneLunga) a.BeginInvoke(Nothing, Nothing) ' I update the GUI passing some parameters Dim a As New Action(Of Integer, String)(AddressOf aggiorna_UI) Me.Dispatcher.Beg...

Stopping an asynchronous TCP server on separate thread in C#

I have implemented an asynchronous TCP server that is spawned by another process. It starts fine and operates as expected, however I am having trouble terminating the server when I end the process that started it. The following is my current TCP server and stopping function from the other process. TCP Server public class StateObj...

Asynchronous Sockets implementation on Android

In iPhone there is Cocoa Asynchronous socket library. Is there a similar library in Java for Android? Can it be done using Java Asynchronous sockets(NIO library) or is there a way I can make use of NDK for Android and use native libraries for asynchronous sockets? ...