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

difference between Run() and Start() #169

Open
allpasscool opened this issue May 12, 2019 · 1 comment
Open

difference between Run() and Start() #169

allpasscool opened this issue May 12, 2019 · 1 comment

Comments

@allpasscool
Copy link

I try to run my program in win10.
When I invoke Run(), logs will be written in my file.
However, if I invoke Start(), logs won't be written in my file.
I think both function will run properly except the logs.
I wonder what happens?
These two functions look similar.

@joelcho
Copy link

joelcho commented Mar 11, 2020

Some docs could find from source code

Run()

// 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

Start()

// Start signals to the OS service manager the given service should start.
Start() error

The results I tested on Windows 10 are as follows:

I configured the service name as bthserv (a Windows system service, related to Bluetooth).

When Run () is called, func (p * program) Start (s service.Service) error will be called, and the service already in the system has not been started.

However, calling Start () will start the service already installed on the system and func (p * program) Start (s service.Service) error is not called.

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

2 participants