IronBlock icon indicating copy to clipboard operation
IronBlock copied to clipboard

Add ability to execute/evaluate workspace in separate thread

Open maciejmatuszak opened this issue 5 years ago • 2 comments

  • Add EvaluateAsync methods to Workspace
  • Use CancelationTokenSource as a method to cancel execution
  • check status of cancelation token after each block evaluation

maciejmatuszak avatar Dec 11 '20 10:12 maciejmatuszak

@richorama I was playing with Evaluate method today. I do not understand why there two Evaluate implementations public virtual object Evaluate(Context context) in Workspace class static object Evaluate(this Workspace workspace, IDictionary<string,object> arguments = null) and in Extensions

I would just overload the method in Workspace, I think I am missing something?

Maciej

maciejmatuszak avatar Dec 14 '20 12:12 maciejmatuszak

Hey @maciejmatuszak I don't think there's any special reason, other that the extension method is for convenience. It could be an overload.

I think you're on the right track. I would suggest that we drop the non-async evaluate, and make everything async (as you don't know what might be further down the program). I'm happy to help out with some of the work here.

richorama avatar Dec 14 '20 13:12 richorama