Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to have only one instance of webmethod running

0 views
Skip to first unread message

eSapient

unread,
Jun 13, 2003, 6:37:02 AM6/13/03
to
How can I ensure that only one instance of my webmethod is running at any
particular instant and that other instances are queued and not started? I
need to do this because my webmethod takes a long time to complete, and the
sum of the memory consumed by many different instances of my webmethod could
trip the memory limit.


MV

unread,
Jun 13, 2003, 9:00:54 PM6/13/03
to
Have you considered the use of .NET serviced components? .NET has a built-in
mechanism for invoking a method call on an object: using a delegate
asynchronously. The client creates a delegate class that wraps the method it
wants to invoke synchronously, and the compiler provides definition and
implementation for a BeginInvoke( ) method, which asynchronously calls the
required method on the object. The compiler also generates the EndInvoke( )
method to allow the client to poll for the method completion. Additionally,
.NET provides a helper class called AsyncCallback to manage asynchronous
callbacks from the object once the call is done.

Your webmethod could then call this serviced component instead of performing
the long-running process itself.

"eSapient" <eSap...@Yahoo.Com> wrote in message
news:eWud8eZM...@tk2msftngp13.phx.gbl...

0 new messages