[WIP] start rewriting to match server::starter 0.33
after receiving #9, I looked at the original code for the first time in ages, and to my surprise, the original code had changed quite a bit. so here's me trying to match server::starter ~0.32~ 0.33
fixes #10
@edvakf Please ask about the context before making micro-style reviews. There are legitimate points in your review, true. But there's always a history behind code.
If this were coming from people whom I have worked with before I'd take this differently, but I don't know you, and you don't know the history behind it. I really don't feel good about random people that I don't know making random style comments without being asked to do so, or trying to understand me and the project history.
On the other hand, if you found bugs, please add tests. They are most appreciated.
Apologies. My goal is to get this PR merged. Please ignore comments irrelevant to that direction.
@edvakf it would help immensely if you could try it out, and see if the features you care about are actually working, and report back with results!
日本語で失礼します… まったく時間がとれておらずもうしわけありませんでした。少し前から、手元で試しているかんじでは問題ないように動いています。
ソースコードを読んでいてp5-server-starterとの差異を3つだけみつけたのでご参考までに。 https://github.com/lestrrat/go-server-starter/compare/topic/compat-f10c90f...harukasan:compat
- ALRMシグナルの扱い: perl版ではwaitのタイムアウトにalarmを使っているのでALRMをハンドリングする必要がありますが、go版では必要ないように思えます(あとperl版はただ無視していますがgo実装ではループを抜けていました)
- AUTO_RESTART_INTERVALがセットされていないとき、perl版はsleepしません
- 毎回pidをFindProcessしている実装が大丈夫かどうか気になっています。単にゴルーチンを起動してそのなかでWaitして待ち受けるほうが安全に思えますが、いかがでしょうか
おお。これテスト書いたほうがいいよねぇ(書きたくない…) でもよさそうな感じなので、このブランチにPRくださいー。
FindProcessはその後でやるかな。というか、その辺りはcontext.Contextを使ったほうがよさそうなので、結構あちこちかわるのでは?と思いました。