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

Parallel runnning of gradle task #1045

Closed
Tracked by #1129
hannah23280 opened this issue Oct 22, 2021 · 8 comments · Fixed by #1122
Closed
Tracked by #1129

Parallel runnning of gradle task #1045

hannah23280 opened this issue Oct 22, 2021 · 8 comments · Fixed by #1122
Labels
enhancement New feature or request
Milestone

Comments

@hannah23280
Copy link

VSCode: v1.61.0
vscode-gradle: v3.8.0

In view of current trend towards cloud and microservice, developer might need to run multiple instances of the same microservice application in the development machine to simulate replicas,
Currently, when i execute a gradle task to run the application via vscode-gradle, the play button become stop button. if i have to run another new instance, i have to click the stop button in order to stop the current running instance, This implies that there is no way to go thru vscode-gradle to run multiple instances of the same application concurrently.

Hence, hope to request to allow parallel running of same gradle task concurrently, similar to what Intellij can do.
For more details on how intellij does this, refer to #798 .
In view that microsoft has currently taken over to maintain this extension, hence i open this new feature request .

@hannah23280 hannah23280 added the enhancement New feature or request label Oct 22, 2021
@CsCherrYY CsCherrYY added this to the 3.8.4 milestone Nov 4, 2021
@CsCherrYY
Copy link
Collaborator

Hi @hanct , I have started to support this feature. IMO #798 (comment) makes sense overall, but some small questions:

  • Do you need specify org.gradle.parallel=true in your properties file first? If not, the Gradle execute tasks one by one actually. (Although you can start more than one tasks at the same time)

  • This behavior might be related to the setting gradle.reuseTerminals. If this setting is set to all or task, the default behavior is to use the previous terminal, so which is better in your mind:

    1. rerun the same task is only available when gradle.reuseTerminals is off
    2. always create a new terminal when run the same task, regardless of gradle.reuseTerminals
    3. add a new setting called something like gradle.allowParallelRun to control the behavior, if ture, follow ii.

@hannah23280
Copy link
Author

hannah23280 commented Dec 14, 2021

Hi. Thanks for the support of this feature!
I am curious, is org.gradle.parallel similar to the requested feature?
Cos my initial request is about allowing us to run the same gradle task more than once, via the gradle GUI.
Say, I click on the run button beside "bootRun" gradle task (provided by spring boot ) to run an application. While the app instance is still running, a few seconds later, I would want to start another instance of the same application again via the GUI. Currently i can't do that , cos the Run button will change to "Stop button", when the first instance is runned

This is equivalent to ,me, opening 2 command prompt. Each running the command line gradle bootRun on the same application. Is that equivalent to parallel feature in gradle?

@hannah23280
Copy link
Author

So my initial thinking is, once we click on the Run button, the Run button remain as it is, so that we can click on it to trigger another execution of the same task. Hopefully there can be a number indicator beside the Run button to indicate how many instances of this gradle task are currently still in execution.

@CsCherrYY
Copy link
Collaborator

got it. I'll add a new configuration to control this behavior (it will be disabled by default, but you can enable it for your case).

Hopefully there can be a number indicator beside the Run button to indicate how many instances of this gradle task are currently still in execution.

Not sure if it's very helpful and feasible:

  • You can easily find the instances via terminal panels since the terminal's title is the task's name
  • I'm not sure the description is the proper place to put the number (it works only for this case)

So my suggestion is to waiting for the feedbacks of this feature. I'll update here once the PR has been created.

@CsCherrYY
Copy link
Collaborator

@hanct #1122 will fix this issue, and could you try https://github.com/CsCherrYY/vscode-test/blob/main/vscode-gradle-3.8.4.vsix to see if this works in your scenario? You can set gradle.allowParallelRun to true and gradle.reuseTerminals to off to enable this feature.

@hannah23280
Copy link
Author

got it. I'll add a new configuration to control this behavior (it will be disabled by default, but you can enable it for your case).

Hopefully there can be a number indicator beside the Run button to indicate how many instances of this gradle task are currently still in execution.

Not sure if it's very helpful and feasible:

  • You can easily find the instances via terminal panels since the terminal's title is the task's name
  • I'm not sure the description is the proper place to put the number (it works only for this case)

So my suggestion is to waiting for the feedbacks of this feature. I'll update here once the PR has been created.

Noted. Agree to wait for feedback for the number indicator. Thanks!

@hannah23280
Copy link
Author

By the way, I presume the debug also works the same. We can click on debug button multiple times, to run application (in debug mode) in multiple instances.

@CsCherrYY
Copy link
Collaborator

@hanct I think 495d08c solves this problem.

Screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants