DynamoDS/Dynamo — pull request #2745 by Benglin (2014-10-16 13:57:55+00:00)
Title: Fixed redundant custom node evaluations

Background
-----
This pull request is meant to fix [an internally tracked issue](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5078) with regards to the way custom nodes are compiled/run with the scheduler enabled. Prior to this change, custom nodes get compiled and executed at the same time immediately whenever they are changed. These changes include user actions like connecting two nodes or editing a node. This is not how custom nodes used to behave -- they typically generate their ```GraphSyncData```, accumulating them in the ```EngineController.graphSyncDataQueue```, before eventually getting evaluated at one go when the home ```WorkspaceModel``` gets evaluated (e.g. clicking the ```Run``` button).

**NOTE**: Scheduler is re-enabled with this pull request.

Changes
-----
1. ```CustomNodeDefinition.Compile``` method is called very frequently, especially with ```Run Automatically``` enabled. This method no longer schedules a ```CompileCustomNodeAsyncTask``` for execution, it goes back to the old behaviour which calls ```GenerateGraphSyncDataForCustomNode``` to generate its ```GraphSyncData```. This way, no immediate ```UpdateGraph``` is done.

2. ```CompileCustomNodeAsyncTask``` now takes in only ```GraphSyncData``` that was generated for a given ```CustomNodeDefinition```, and then call ```EngineController.UpdateGraphImmediate``` like it used to do.

3. A new variant of ```EngineController.GenerateGraphSyncDataForCustomNode``` method is introduced to push newly generated ```GraphSyncData``` into an internal queue of ```EngineController```, instead of scheduling a ```CompileCustomNodeAsyncTask``` immediately. This list of ```GraphSyncData``` will be used to ultimately generate ```CompileCustomNodeAsyncTask``` when ```DynamoModel.RunExpression``` is invoked (through the ```Run``` button or when ```Run Automatically``` is enabled).

4. ```ProcessPendingCustomNodeSyncData``` is called from ```DynamoModel.RunExpression``` before a graph update (i.e. before any ```UpdateGraphAsyncTask``` is scheduled). It internally schedules ```CompileCustomNodeAsyncTask``` so that changes in ```CustomNodeDefinition``` get reflected.

5. Redundant method ```EngineController.ComputeSyncData``` has been removed.

Unit testing
-----
I have used Isolation tool to run all unit test cases that do not depend on Revit, they produce the exact same results with and without this fix. That includes all the custom node related test cases. I have also manually tested that custom nodes work with basic use cases.

Hi @ikeough, please take a look, thanks!