Spiny
September 28th, 2005, 03:15 PM
Hi
I'm an experienced developer, but only recently come to .NET. Would anyone be so kind as to shed some light on a question?
I have a requirement to code a method that's called (indirectly) from a web service. The method needs to run asynchronously with the web method returning, possibly before I have finished processing.
My first thought was, just use BeginInvoke(), but here's the crucial part : the caller dosen't want to wait around at all for a return & won't be calling EndInvoke(). The web service call may need to return before I complete so it's reference to my object may go out of scope before my method has finished.
I'll be posting the results of my method to a database which another process will be polling.
Q: Will the caller be OK using BeginInvoke() on my method? (assuming I make it thread safe :) )
..or would something else be safer? Maybee using remoting and marking my method with the [Oneway] attribute?
Any help gratefully recieved :)
I'm an experienced developer, but only recently come to .NET. Would anyone be so kind as to shed some light on a question?
I have a requirement to code a method that's called (indirectly) from a web service. The method needs to run asynchronously with the web method returning, possibly before I have finished processing.
My first thought was, just use BeginInvoke(), but here's the crucial part : the caller dosen't want to wait around at all for a return & won't be calling EndInvoke(). The web service call may need to return before I complete so it's reference to my object may go out of scope before my method has finished.
I'll be posting the results of my method to a database which another process will be polling.
Q: Will the caller be OK using BeginInvoke() on my method? (assuming I make it thread safe :) )
..or would something else be safer? Maybee using remoting and marking my method with the [Oneway] attribute?
Any help gratefully recieved :)