We have an application which at certain times needs to execute 'tasks' in order to do some work. These tasks currently are just commands (read: dodgy VB scripts) being fired off and then monitoring the process for completion or aborting if it 'times out', however we don't have enough control over the execution.
I would like to integrate a scripting engine or scripting host to enable us to execute the scripts within our application (in another appdomain if possible) and maintain some control over them. I'd envisage that we have scripts which follow an interface similar to:
void Initialize();
void Destroy();
void Execute();
void Abort();
int GetProgress();
Of course, the above is probably not what would be in the code, however you get the idea... Essentially from our application we could call Initialize
, then Execute
, poll GetProgress
until the return value is 100 or whatever, then at the end either call Destroy
or Abort
then Destroy
if we need to cancel or it goes past the timeout period.
The main thing that the scripts would need to be able to do is AD queries, and interact with the Shell (e.g. Map a network drive, or Disconnect one).
I've looked into a few options to do this - one which I have implemented a prototype of uses Boo as the language and essentially loads the script on the fly to compile and execute as an 'assembly' in memory. I like the way this works but I'm not sure how well it would be accepted not being a 'well known' language etc.
Other options I'm looking at are Python (IronPython), Ruby (IronRuby), PowerShell, and maybe VB, but I'm not sure about the ease of implementation with VB.
Any opinions, comments, suggestions or even resources which might point me in the right direction?