FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add new `SocketServer` and deprecate `Server` to avoid class name collisions by clue · Pull Request #263 · reactphp/socket · GitHub

Add new SocketServer and deprecate Server to avoid class name collisions - #263

Merged
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:socketserver
Jul 27, 2021
Merged

Add new SocketServer and deprecate Server to avoid class name collisions#263
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:socketserver

Conversation

clue commented Jul 26, 2021

Copy link
Copy Markdown
Member

This changeset adds a new SocketServer class as a replacement for the Server class to avoid class name collisions and ambiguities.

// deprecated
$socket = new React\Socket\Server(0);
$socket = new React\Socket\Server('127.0.0.1:8000');
$socket = new React\Socket\Server('127.0.0.1:8000', null, $context);
$socket = new React\Socket\Server('127.0.0.1:8000', $loop, $context);

// new
$socket = new React\Socket\SocketServer('127.0.0.1:0');
$socket = new React\Socket\SocketServer('127.0.0.1:8000');
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context);
$socket = new React\Socket\SocketServer('127.0.0.1:8000', $context, $loop);

The new SocketServer class has been added with an improved constructor signature as a replacement for the previous Server class in order to avoid any ambiguities. The previous name has been deprecated and should not be used anymore. In its most basic form, the deprecated Server can now be considered an alias for new SocketServer. Existing code continues to work as-is.

Builds on top of reactphp/http#417 and #260

clue added this to the v1.9.0 milestone Jul 26, 2021
clue changed the title Add new SocketServer and deprecate Server to avoid class name collisions Add new SocketServer and deprecate Server to avoid class name collisions Jul 26, 2021
WyriHaximus self-requested a review July 27, 2021 07:07
Comment thread README.md
WyriHaximus merged commit 22d3b31 into reactphp:master Jul 27, 2021
clue deleted the socketserver branch July 27, 2021 07:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL