Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify usage by supporting new Socket API without nullable loop arguments #419

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

clue
Copy link
Member

@clue clue commented Jul 27, 2021

This changeset simplifies usage by supporting the new Socket API without nullable loop arguments.

// old
$http = new React\Http\HttpServer($handler);
$http->listen(new React\Socket\Server(8080));

// new
$http = new React\Http\HttpServer($handler);
$http->listen(new React\Socket\SocketServer('127.0.0.1:8080'));

Note that this doesn't affect the API of this package at all, but does use the improved API of the referenced Socket component. Existing code continues to work as is.

Together with #418, #417 and #410, this means we can now fully rely on the default loop and no longer need to skip any arguments with null values. Additionally, this now consistently uses the HttpServer and SocketServer class names to avoid class name collisions and ambiguities.

Builds on top of reactphp/socket#264 and reactphp/socket#263

@clue clue added this to the v1.5.0 milestone Jul 27, 2021
@clue clue force-pushed the socket branch 2 times, most recently from 59f1d20 to 18906cb Compare August 3, 2021 13:16
@clue clue changed the title [WIP] Simplify usage by supporting new Socket API without nullable loop arguments Simplify usage by supporting new Socket API without nullable loop arguments Aug 3, 2021
@clue
Copy link
Member Author

clue commented Aug 3, 2021

Rebased now that #418 has been merged and Socket v1.9.0 has been released :shipit:

@clue clue requested a review from WyriHaximus August 3, 2021 13:21
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