I posted a CodeProject Article this morning with a VMWareTasks C# library on top of the VIX API. It exposes a better programming model for the 99% of those synchronous VMWare scenarios where you don't want to deal with jobs or other more complex constructs. I think we can all benefit from reimplementing the same thing less often!
I'd love to get more features/patches for the library, feel free to (re)use and contribute.
cheers
dB.
My timeouts are guesses based on some experience. I am happy to adjust the defaults if someone can argue something more meaningful. Also you can dynamically change the timeouts in the library.
I am not quite sure I understand the question right.
If the question is whether one should use a synchronous API vs. an asynchronous one (callbacks). The asynchronous API has lots of advatages, but is harder to implement. If you're building UI (eg. VI client), then the asynchronous model is what you want. But if you're building a test tool that restores snapshots, then you want something synchronous.
If the question is whether my implementation of an active wait is a bad one, then the answer is yes I think a big improvement to my library could be to replace the active wait by a blocking wait on an event with a timeout that is canceled on job callback. I'd love it if you sent me a patch!
Will do.
Re 2.2:
As I understand your re-design, you want to block the entire thread by implementing ICallback with a timeout?
I will try to figure something out. first I have to read up on async patterns.
DBlock,
Try the attachedcode for blocking waits.
Improvements: http://www.xtremevbtalk.com/showthread.php?t=303781
Sweet!
Thanks for the update of your project at my site, http://ww.vi-toolkit.com
Sorry if the wording wasn't clear enough, you are welcome to make any change on there (which is true for anyone who would like to make improvements/corrections on the site)
As it is now, the projects on the site are a collection of projects elsewhere - written by other people - with the intention of making them easier to find.
Eg. arise the awareness to more people of the availability of YOUR project(s).
Due to limitations of time available that i can spent on the site my own content is now limited to adding more command references of the VMware SDK's available.
That and adding links to interesting projects/code I "stumble" over.
thanks again,
--
Wil
_____________________________________________________
VI-Toolkit & scripts wiki at http://www.vi-toolkit.com