VMware {code} Community
dblock
Enthusiast
Enthusiast

VMWareTasks: A VIX API C# Library (let's reinvent less wheels)

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.

Update: I posted a new build 1.0.1604.0:

0 Kudos
25 Replies
dblock
Enthusiast
Enthusiast

  1. 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.

  2. I am not quite sure I understand the question right.

    1. 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.

    2. If the question is whether my implementation of an active wait is a bad one, then the answer is yes Smiley Happy 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!

  3. Will do.

0 Kudos
fixitchris
Hot Shot
Hot Shot

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.

0 Kudos
fixitchris
Hot Shot
Hot Shot

DBlock,

Try the attachedcode for blocking waits.

Improvements: http://www.xtremevbtalk.com/showthread.php?t=303781

0 Kudos
dblock
Enthusiast
Enthusiast

I've changed the spin wait for an async callback and an event. Take a look at the source:

0 Kudos
fixitchris
Hot Shot
Hot Shot

Sweet!

0 Kudos
wila
Immortal
Immortal

Hi

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

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos