asynchronous

Asynchronous Event Dispatch in Java

I'm in the midst of porting a C# program over to Java that makes heavy use of delegates and the delegate's BeginInvoke method to notify of an event asynchronously. Take a data communication thread for example. It might have to notify another worker thread of its state as well as the GUI. It seems to me that the best way to notify of th...

Unit testing asynchronous function

In the following code sample I have an Async Calculator class. This is injected with an ICalc, which will be a syncronous calculator. I use dependency injecting and mock the ICalc because this resembles my true scenario, though I guess the mocking isn't really of relevance to the question. The AsyncCalc has a function which will call ano...

is there a way to load an iframe asynchronously

i have a webpage with an iframe pointing to another website. I dont want this to block the loading of the rest of the page. is there a way to load it asyncrounously? ...

Dealing with high number of real-time calls to partner API in Rails

My Rails app needs to make a call to a partner's RESTful API for every request that it receives on a particular controller's action. I need to pass in request-specific parameters (e.g. IP, user-agent, etc.) to the partner API, and return the response I get to the user. Since the call to the partner API is very user-specific, I can't cach...

How To Make A jQuery Async Multi-Response From One PHP Script Run

I have a run.php that has a button on it called "Run". Clicking it does a jQuery $.get() AJAX call back to a response.php on the server, and sends the result to a Javascript callback function getResponse(sData) inside run.php's HTML for display back on the browser. I want to have things such that as response.php runs through a list of ta...

How to specify a timeout value on HttpWebRequest.BeginGetResponse without blocking the thread

Hi all … I’m trying to issue web requests asynchronously. I have my code working fine except for one thing: There doesn’t seem to be a built-in way to specify a timeout on BeginGetResponse. The MSDN example clearly show a working example but the downside to it is they all end up with a SomeObject.WaitOne() Which again clearly state...

Are there c++ classes or functions to use for asynchronous sockets between Unix and Windows?

Does someone please tell us where to find classes or functions that communicate with asynchronous sockets (TCP and UDP) between programs runing on unix and windows? Thanks for your reply PS; I have already programs that communicate with synchronous sockets. ...

Asynchronous HTTP request

require 'net/http' urls = [ {'link' => 'http://www.google.com/'}, {'link' => 'http://www.yandex.ru/'}, {'link' => 'http://www.baidu.com/'} ] urls.each do |u| u['content'] = Net::HTTP.get( URI.parse(u['link']) ) end print urls This code works in synchronous style. First request, second, third. I would like to send all requests...

.NET wrapping a call/callback pair to appear synchronous

Hi. I have a 3rd party COM object I call that uses a event callback to signal it has completed its task. obj.Start(); then sometime later it will raise an event to say it is done. void OperationFinished() I would like to be able to do this operation synchronously and have tried to use AutoResetEvents to handle this e.g. obj.Sta...

How to take the result of a method called Asynchronously?

Hello, to not block the UI of my applications when there is a long operation I use to do: Public Sub ButtonHandler() handles Button Dim auxDelegate as Action auxDelegate = New Action(AddressOf DoAction) auxDelegate.BeginInvoke(AddressOf EndAction,Nothing) End Sub Private Sub DoAction() ''# Do long time operations here...

How to create a resetable "process" or "thread" in Ruby?

I've got this script, that uploads some files, connects via ssh and does some stuff on the remote server, kinda like deployment script, and I want to make it run whenever I want to and to be able to reset it in the middle of processing. def deploy # some stuff happens here end def do_deploy $deploy.kill! if $deploy $deploy = Th...

Async HTTP request using GIO

I would appreciate an example on how to perform an async HTTP POST request using Python's GIO binding. Edit: Example sought without using Twisted. ...

Is BackgroundWorker a good subsititute for AsyncOperationManager?

Here's what I'm trying to solve: My class (which could be hosted by an UI app or a windows service or whatever), needs to receive windows messages. Somewhere around here, someone gave the suggestion (and some source code) to create a windows form in a separate thread that will create the form and whenever a windows message that I'm inte...

Understand the alternatives for calling methods asynchronously in .NET

What's the difference between calling .NET methods asynchronously by using: BeginInvoke/EndInvoke vs. IAsynchResult vs. Specific object asynchronous methods (WebClient, for example) I assume the difference between the first two and the third one is that some objects (WebClient in this case) natively support asynchronous calli...

HowTo: BeginProcessRequest

Writing a Service that is running on IIS. Basically looks like this: void ProcessRequest(HttpContext context) { <Init Stuff> <Access DB> // This may potentially stall for DB access <Write Output to conext stream> } By stalling the thread in the <Access DB> section we are basically blocking one of the IIS service thre...

Implementation of an async method in Python DBus

How do I implement an async method in Python DBus? An Example below: class LastfmApi(dbus.service.Object): def __init__(self): bus_name = dbus.service.BusName('fm.lastfm.api', bus=dbus.SessionBus()) dbus.service.Object.__init__(self, bus_name, '/') @dbus.service.method('fm.last.api.account', out_signature="s") ...

how to deal with async calls in Ajax 4.0(using jquery?)

in my code i have done something like this. $.get('/Home/Module/Submit', { moduleName: ModName, moduleParameters: moduleParameters }, function(result) { $("#" + target).html(result); }); when i put alert in the function(result) {..} it shows html perfectly(both in a...

Running a Django test server under twisted web

As I'm writing an application which uses twisted web for serving async requests and Django for normal content delivery, I thought it would have been nice to have both run under the same twisted reactor through the WSGI interface of Django. I also wanted to test my app using the nice test server facility that Django offers. At first I si...

are glib signals asynchronous?

When using glib to dispatch signals through emit, are all the "listeners"/handlers called back-to-back or is control relinquished to the event loop after each listener/handler? ...

php asynchronous call and getting response from the background job

Hello, I have done some google search on this topic and couldn't find the answer to my question. What I want to achieve is the following: the client make an asynchronous call to a function in the server the server runs that function in the background (because that function is time consuming), and the client is not hanging in the mean...