asynchronous

Implementing Asynchronous method

I'm looking to implement a synchronous and asynchronous version of a method within a class library. Currently I've done this so that the Async method fires off a new Thread and does it's processing. To determine if the action has completed the user should poll a property to see if it has finished. I'd like to improve it, I think it woul...

Run PHP Task Asynchronously

I work on a somewhat large web application, and the backend is mostly in PHP. There are several places in the code where I need to complete some task, but I don't want to make the user wait for the result. For example, when creating a new account, I need to send them a welcome email. But when they hit the 'Finish Registration' button, I ...

Ajax: Building HTML vs injecting HTML

Trying to comply with StackOverflow's suggestion of asking a question, not creating a discussion, let us consider these two methods that use the HTTPAsyncRquest to update a web page without refreshing it: 1) Data returned by AsyncRequest is parsed/interpreted in order to build the resulting HTML that updates the page e.g. JSON::parseAn...

Will the .NET GC mess with an abandoned object executing a method asynchronously?

In .Net, suppose I instantiate an object that starts an asynchronous process (using Delegate.BeginInvoke on one of its methods), then abandon the object by setting the reference to it to null or allowing it to go out of scope. Will the Garbage Collector attempt to collect the object while the asynchronous process is in progress? If not, ...

Incorets script proxy generating for Web Services Asynchronous WebMethods

I have created an asynchronous web method in one of my web services, which I am trying to call from Javascript. The problem is that the proxy script generated for the client includes two methods instead of one. For each asynchronous web method I define a BeginXXX and EndXXX, where XXX is the method name. When calling the web service from...

When to use AsyncOperation and AsyncOperationManager

Hi, I've spent many many hours tonight reading up on implementing the event-based asynchronous pattern Unfortunately, I haven't been able to find any articles at all on witting a class that only supports one Async invocation. Every example I've seen assumes that a method call will be called more than once and thus, should have a userS...

How to do asynchronous inter thread communication on platform with pthreads

For example on windows there is MsgWaitForMultipleObjects that lets you asynchronously wait for windows messages, socket events, asynchronous io (IOCompletionRoutine), AND mutex handles. On Unix you have select/poll that gives you everything except possibility to break out when some pthread_mutex is unlocked. The story: I have applica...

Asynchronous implmentation help please

Hi, I'm trying to develop a class that supports an asynchronus method invocation. This is what I've come up with so far, however, I'm not sure if its the 'right way' of doing it. I only want the async method to be executed once, it doesn't have to support multiple executions so I didn't use the AsyncOperationManager class. Can someone...

Assyncronous interaction using Sys WebForms PageRequestManager

Hi guys, I'm trying to display a panel to the user when an asynchronous call is made, but only if that happend from a specific call. using the normal "get control" script I have mine like: function pageLoad() { try { var manager = Sys.WebForms.PageRequestManager.getInstance(); manager.add_endRequest(OnEndRequest);...

What is a proper implementation of the IAsyncResult interface?

I'm looking into adding some flexibility to a class that I've created which establishes a connection to a remote host and then performs an exchange of information (a handshake). The current implementation provides a Connect function which establishes the connection and then blocks waiting on a ManualResetEvent untill the two parties have...

My simple namedpipe sample works fine on my vista/win2k8 server box but fails on win2k3

Hi i am using the new named pipes feature of .net35 it is very easy to use on same machine (win2k8) but with the exact same code, i get the following error immediately i call EndRead on the pipestream in the async callback handler on the client under win2k3 server: "The operation was canceled." any help will be appreciated. thanks. ...

Asynchronous File Copy/Move in C#

What is the correct way to do file copy/move asynchronously in C#? ...

tidy code for asynchronous IO

Whilst asynchronous IO (non-blocking descriptors with select/poll/epoll/kqueue etc) is not the most documented thing on the web, there are a handful of good examples. However, all these examples, having determined the handles that are returned by the call, just have a 'do_some_io(fd)' stub. They don't really explain how to best approac...

Does this Asynchronous Lambda Cryptica Code do what I think?

Action<SPItemEventProperties> deleteAction = DeleteWorkspace; AsyncCallback deleteDone = deleteAction.EndInvoke; SPSecurity.RunWithElevatedPrivileges(() => deleteAction.BeginInvoke(properties, deleteDone, null)); So this is suppose to call DeleteWorkspace Asynchronously and then call EndInvoke when its done, I wrote it but ...

cancel stream request from WCF server to client

Hi, I posted about stream request here [wcf-chunk-data-with-stream]:http://stackoverflow.com/questions/853448/wcf-chunk-data-with-stream I solved that task but now when i close request in client part server continue to send data. is it possible to cancel stream request from WCF server to client? ...

Implementing Synchronous network call in java waiting for an ack message?

How would you go about implementing the equivellent of a wait until complete method call in Java? Basically what I want to do is hava a method that sends a message over the network to a server application and waits till it gets the appropriate Ack message from the server with either an operation completed successfully or operation faile...

How to cancel a long-running Database operation?

Currently working with Oracle, but will also need a solution for MS SQL. I have a GUI that allows users to generate SQL that will be executed on the database. This can take a very long time, depending on the search they generate. I want the GUI/App to responsive during this search and I want the user to be able to cancel the search. ...

WCF client getting a TimeoutException (and I AM closing my connections)

Here's the thing... I've been working on this issue for a long time now with no luck I have a WCF service hosted on IIS (I also tried in a console host and I get the same behavior) which I call thru my scvutil created proxy, and the service fails to respond after a few (very few calls). But, here are a few clues: 1- It only happens on ...

.Net Windows Forms - Limit form navigation while waiting on asynchronous work.

On clicking a button, a query is executed in a background worker. It is asynchronous so that I can change the button to "Cancel" so the user can cancel the process if it runs longer than expected. This all works fine. But, I do not want the user to be able to navigate away from this location to do other things on the form. They must ...

Doing a postback after checking an asynchronus result in .Net 1.1/c#

I have code that gets data from a server and places them in a TreeView control (.Net 1.1 version - the one that has Microsoft.Web.Ui.etc.etc as a namespace). The TreeView is displayed in a div area that becomes visible when the user clicks a certain button. The problem is after filling up the first level of the Tree, the div area is al...