Connections now resolve with a ConnectionInterface#82
Connections now resolve with a ConnectionInterface#82clue merged 1 commit intoreactphp-legacy:masterfrom
Conversation
|
Note that this It is believed this is a good thing currently, because we aim to avoid inter-package dependencies. In the future, we will look into merging these into a single package again, in order to avoid confusion. This debate is best left out of this PR, be assured I'll file new tickets and link here if this ticket is accepted 👍 |
See #86 for future plans to merge this into the Socket component. |
This PR changes the resolution value from
Stream(which implements theDuplexStreamInterface) to an instance implementing the newConnectionInterface, which in turn implements theDuplexStreamInterface.In other words: Each
ConnectorInterfacenow has aconnect()method that resolves to aConnectionInterface.Because the
ConnectionInterfaceimplements the same base interfaceDuplexStreamInterface, it behaves just like a normal stream resource, so consumer code can simply use the new typehint and continue to work unchanged.The
ConnectionInterfacealso implements two new methods which are not available for the underlying stream:getRemoteAddress(): ?stringgetLocalAddress(): ?stringResolves / closes #44
Refs reactphp/reactphp#199
Refs reactphp/socket#65
Refs reactphp/socket#68