the subjects says much I think.
Basically I want to create my own long running tasks asynchronously.
I want to have a BeginMyOwnLongTediousMethod
and EndMyOwnLongTediousMethod
You know like the framework already has the methods of
BeginExecuteReader that return an IAsynchResult.
Is there any way I can do my own?
Thanks!!!
> Basically I want to create my own long running tasks asynchronously.
> I want to have a BeginMyOwnLongTediousMethod
> and EndMyOwnLongTediousMethod
>
> You know like the framework already has the methods of
> BeginExecuteReader that return an IAsynchResult.
>
> Is there any way I can do my own?
Yes, of course.
Start here:
http://msdn.microsoft.com/en-us/library/ms228963.aspx
Read that page, and follow the various links that relate to implementing
your own asynchronous API.
Keep in mind that you may find that it's simpler to, rather than add an
asynchronous API to your own classes, just use your classes from an
existing asynchronous mechanism in .NET (such as using BackgroundWorker).
Pete
http://msdn.microsoft.com/en-us/library/bz33kx67.aspx
Jeremy Shovan
"Varangian" <ofm...@gmail.com> wrote in message
news:af2009d6-615e-4a9c...@24g2000hsh.googlegroups.com...
> Yes thanks. but why I can't find any example on the internet?!
I'm not sure. I'm confident one exists, even if I don't personally know
where it is exactly.
Perhaps MSDN doesn't elaborate because they feel that someone who is
qualified to implement the async design pattern in their class should have
enough experience already to know how to do so. It's definitely not
something for beginners.
There are other ways to accomplish the same thing without introducing an
async API in your class, and those ways are more suitable for someone who
doesn't already have enough multi-threading programming experience to know
how to implement the patterns described by MSDN.
Pete