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

Spawn a fire-and-forget process #5

Open
Vogel612 opened this issue Sep 13, 2015 · 2 comments
Open

Spawn a fire-and-forget process #5

Vogel612 opened this issue Sep 13, 2015 · 2 comments

Comments

@Vogel612
Copy link

It would be nice to allow spawning a process without terminating it.. ever. So a standalone process that doesn't even clean up after themselves.

Implementation might be as simple as dropping ready as mandatory argument, but you know better than me. I am also willing to open a PR, if necessary 😄

@npetzall
Copy link

To my understanding this is already possible. Just executing a SpawnProcessTask and never executing the KillProcessTask will leave the task running.

However you can't start a process that has no output.

@rkrisztian
Copy link

rkrisztian commented Sep 26, 2017

The documentation is confusing to me in that regard. It says:

Once the build draws to a close, the stopServer task is then used to gracefully shut down the server process.

What calls the stopServer task? Correct me if I'm wrong (I'm not a native speaker of English), but in my understanding, the sentence implies that something will call it, but I see nothing like that in the source code of the plugin. Or do you mean "can be used"?

Also, you write:

A typical application of this plugin is for stopping and starting an embedded web server when running functional tests from within your build.

So that's like: integrationTest.finalizedBy stopServer.

But for such things, shouldn't we just use the https://github.com/psxpaul/gradle-execfork-plugin? Which makes sure that if you don't specify after which task the process should be stopped, it will be at the end of the build.

But I myself see an important difference between the two plugins, and that's the following use case:

gradle startServer
# execute manual commands needing that server
# and then optionally:
gradle stopServer

You can't do this use case at all with the execfork plugin. And I think the documentation should reflect that more clearly.

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

No branches or pull requests

3 participants