voryx / Thruway

PHP Client and Router Library for Autobahn and WAMP (Web Application Messaging Protocol) for Real-Time Application Messaging
MIT License
674 stars 117 forks source link

Declaring of some properties as protected #333

Closed duckboy81 closed 4 years ago

duckboy81 commented 4 years ago

Ref #164

I am going to close this issue as this discussion is more of a programming theory discussion.

If there is a specific use case that is problematic, please feel free to open an issue.

Without protected variables, I am unable to override the handleRouterStart function in RatchetTransportProvider. I would like to use unix sockets, however the current implementation of the function forces a tcp listener.

$socket = new Reactor('tcp://' . $this->address . ':' . $this->port, $this->loop);

Whereas my implementation exists as:

$socket = new Reactor('unix://' . $this->socketPath, $this->loop);

Now I have to copy over the entire class to make one change. Thoughts?

duckboy81 commented 4 years ago

The more moving parts that are exposed, the more likely it is that things will go wrong.

I think the onus to not break functionality should rest with the developer using the package, though from a standpoint of supporting your package, I could see why you'd rather not.

mbonneau commented 4 years ago

@duckboy81 There are many architecture issues right now. Hopefully will start moving toward better ideas. Difficult to fix something that is not technically broken.

Will close this issue now. If I don't get to the PR on the RatchetTransportProvider, feel free to ping me there.