Commit Graph

9 Commits

Author SHA1 Message Date
Ethan Buchman 4d991acae0 common: comments for Service 2017-11-29 05:16:15 +00:00
Anton Kaliaev c2fcc093b2
remove bool from Service#Reset 2017-11-27 23:42:36 -06:00
Anton Kaliaev e6164d4052
change service#Stop to be similar to Start 2017-11-06 12:47:23 -05:00
Anton Kaliaev 4123d54bf6
change service#Start to return just error (Refs #45)
```
@melekes
yeah, bool is superfluous
@ethanfrey
If I remember correctly when I was writing test code, if I call Start() on a Service that is already running, it returns (false, nil). Only if I try to legitimately start it, but it fails in startup do I get an error.
The distinction is quite important to make it safe for reentrant calls. The other approach would be to have a special error type like ErrAlreadyStarted, then check for that in your code explicitly. Kind of like if I make a db call in gorm, and get an error, I check if it is a RecordNotFound error, or whether there was a real error with the db query.
@melekes
Ah, I see. Thanks. I must say I like ErrAlreadyStarted approach more (not just in Golang)
```
2017-11-06 12:18:04 -05:00
Ethan Buchman c8805fd7de metalinter fixes from review 2017-10-04 00:13:58 -04:00
Zach Ramsay cf49ba876f linter: couple fixes 2017-10-03 17:23:14 -04:00
Zach Ramsay 3c57c24921 linting: next round of fixes 2017-09-22 12:14:27 -04:00
Anton Kaliaev ed76afd409
Logger interface and tmLogger impl based on go-kit 2017-05-05 21:43:07 +04:00
Ethan Buchman 356657a37b move all files to common/ to begin repo merge 2017-04-18 16:33:22 -04:00