-
Notifications
You must be signed in to change notification settings - Fork 685
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
Point to godoc.org in the README. #50
Comments
Have you read https://godoc.org/github.com/kardianos/service ? From the docs: type Service interface {
// Run should be called shortly after the program entry point.
// After Interface.Stop has finished running, Run will stop blocking.
// After Run stops blocking, the program must exit shortly after.
Run() error
...
} From this I can see that (a) Run blocks, (b) when Run returns, the program should exit. Your work should be done in: type Interface interface {
// Start provides a place to initiate the service. The service doesn't not
// signal a completed start until after this function returns, so the
// Start function must not take more then a few seconds at most.
Start(s Service) error
// Stop provides a place to clean up program execution before it is terminated.
// It should not take more then a few seconds to execute.
// Stop should not call os.Exit directly in the function.
Stop(s Service) error
} Pay attention to "Start function must not take more then a few seconds at most.", meaning you need to run |
turtlemonvh
added a commit
to turtlemonvh/service
that referenced
this issue
Mar 1, 2016
Fixes issue kardianos#50.
I think that one can be closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the library. I went through the example and used simple as reference: https://github.com/kardianos/service/blob/master/example/simple/main.go
Here is my run function:
// run the program
func (p *program) run() {
configuration := InitConfiguration()
}
When I run my app using:
$GOROOT/bin/myApp
My app seems to block the run call forever, I was expecting Run to be executed in the background. Am I missing something here?
It would be great if you can update the README.md with additional information on usage.
Thanks once again.
The text was updated successfully, but these errors were encountered: