John Bush <[EMAIL PROTECTED]> wrote:

> When using Begin/End methods to asynchronously invoke a method, my
> understanding is that you always need to call the End method or
> resources will be leaked.

To make life easy, I always call the End method in a callback, passed to
the Begin half of the method. Basically, programming in a manually
written continuation passing style (CPS:
http://en.wikipedia.org/wiki/Continuation_passing_style). React in the
continuation as you will - basically, return or whatever after you've
called the *End method.

FWIW, I detest and abhor the newer "easy" *Async methods that use
stateful, non-functional style events rather than callbacks - I find it
makes writing asynchronous code far harder.

-- Barry

-- 
http://barrkel.blogspot.com/

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to