monto-editor / broker

BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Implement dependencies between products of different files #7

Open svenkeidel opened 8 years ago

svenkeidel commented 8 years ago

This feature allows services to declare dependencies to products of other files if they need them. A possible use case is that a java file foo.java contains an import statement to the file bar.java. Then the type checking of foo.java probably depends on the type checking of the imported file bar.java. In a case like this, instead of producing a product, the service replies back to the broker and declares a new dependency. If bar.java isn't available to the broker yet, the broker then notifies the IDE to send the contents of bar.java. Then the services start producing products for bar.java. As soon as the type checking for bar.java is done, the broker can notify the type checking service again, that the type checking for foo.java can be started.

To track the dependencies of different files, the broker manages an graph that contains only the cross file dependencies. On every new product, the broker performs lookup on this graph to find potential products that can be build now.

Preliminary work for this feature is done in the filedeps branch.