-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible for worker to query parent #51
Comments
Just a word of caution : since we are using |
One use case we badly need it for is #110 So moving this to a higher priority. Use case 1When a child comes up it should query the parent about all the files it has open and their contents. This will make sure that the child (by default working on the file system) is never out of date from the server. Use case 2The child is very aggressive about keeping its tsconfig up to date. This is great for new ts files, removed ts files, tsconfig changed. Currently child can only reload it all from the file system and cannot notify the parent that it would like in memory changes also. This will allow the child to query the parent for this information and we can be less aggressive about pushing the data to the child e.g. on active tab change. Use case 3Add message type for notifications. Useful for debugging Use case 4Add messages for files that are built. This will potentially require mid execution call-out from |
…hild into `RequesterResponder` base class refs #51
As soon as one thing is async. Everything is async. If we want true (query->response) within a function executing in the child we already need to make all our functions promise based. |
Its not strictly required, as our use cases not really need the child to stop midway before responding to the parent query. But being completely async at some point is a good idea to have at some point. So now that I've done the grunt work, I will commit it. However it does make it a bit hard for a newbie to understand the project. I apologize to that person. Nevertheless promises are something that every decent JS developer will eventually need to learn. I will do a separate iteration of making debugging easier + documentation. |
Plus I suspect it will help us if the language service ever becomes async microsoft/TypeScript#1857 |
…dToIpc` (as it is going to be bidirectional) refs #51
One issue to solve now is of cyclic references. child ---needs as a responder---> projecService ----needs to query ----> child. Doable, just needs more refactoring and thought. |
Note: 👍 on promisifying: Having the same signature |
Currently we only have
host ---query---> worker ---response---> host
Allow the worker to query to host. This is useful for stuff like notifications and even simple log debugging.
The text was updated successfully, but these errors were encountered: