Skip to content
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

Task API: TaskExecution contain a TaskResult #49665

Closed
rickvanprim opened this issue May 11, 2018 · 5 comments
Closed

Task API: TaskExecution contain a TaskResult #49665

rickvanprim opened this issue May 11, 2018 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster tasks Task system issues

Comments

@rickvanprim
Copy link

I think it would be useful if a TaskExecution provided a way to get the result of the Task being executed which would include the exit code, stdout, and stderr. This would allow for things like providing a different notification when a Task completes depending on success or failure, or scanning the output and reporting back certain details.

I also think it would be useful if a cached TaskExecution could be polled to see when it has a TaskResult, so that if an extension kicks off a Task, it can monitor it for completion, instead of having to subscribe to onDidEndTask when it's only concerned with a particular Task.

@vscodebot
Copy link

vscodebot bot commented May 11, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the tasks Task system issues label May 11, 2018
@dbaeumer dbaeumer added the feature-request Request for new features or functionality label May 11, 2018
@dbaeumer
Copy link
Member

I still don't see why polling is preferred over eventing especially in a system like NodeJS. Can you let me know in which case polling is preferred.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label May 11, 2018
@rickvanprim
Copy link
Author

I don't know NodeJS well enough to directly address that, so it could very well be unnecessary. My perspective is that I would expect to be able to track the life of a Task without having to subscribe to a global event and compare each ending Task with the one I'm interested in.

For comparison, creating a process in Windows/Linux/MacOS returns a process ID which can be used query the state of that process, terminate it, etc. Your terminateTask() API fits that pattern (using the TaskExecution as the identifier). For completeness I'd expect to be able to get the TaskResult from a similar API, or a future to the TaskResult which could then be waited on.

@dbaeumer
Copy link
Member

Since NodeJS is an async event based system (single threaded) polling can only be done using a setInterval which at the end results in the same as adding an event handler to the task end event. I will look into how to best allow for query (which does make sense) but not to encourage polling.

@vscodebot
Copy link

vscodebot bot commented May 21, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster tasks Task system issues
Projects
None yet
Development

No branches or pull requests

2 participants