amphp / websocket-server

WebSocket component for PHP based on the Amp HTTP server.
MIT License
114 stars 17 forks source link

Please could you tag a version #10

Closed assertchris closed 5 years ago

assertchris commented 5 years ago

First off, thanks for this library. I used it, with consummate ease, to implement a ludicrous thing.

The reason I'm asking is because it's currently not possible to use without dropping minimum stability levels. Unless I'm overlooking something besides locking to a SHA...

kelunik commented 5 years ago

Hey, thanks!

I'm not totally happy with the nameing of beforeOnStart / afterOnStart / beforeOnStop / afterOnStop, other than that it's ready for v1.0.0, I guess.

Any suggestions?

Without making onStart() / onStop() final, I fear many people will forget to call the parent method and will wonder what's wrong and loose quite some time there.

assertchris commented 5 years ago

How about beforeStart, afterStart, beforeStop, and afterStop..? onX is just the exact point in time, and beforeX and afterX follow the same pattern.

kelunik commented 5 years ago

I thought about that as well, but when afterOnStart is called, the server is still starting and not started, yet.

I implemented a check in handleRequest now, throwing if the user overrides onStart() but doesn't call parent::onStart(). I think it's fine now.

assertchris commented 5 years ago

That seems like a fine solution.

kelunik commented 5 years ago

Done.

assertchris commented 5 years ago

Thank you for the quick turn-around!