reactphp / socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
https://reactphp.org/socket/
MIT License
1.21k stars 157 forks source link

Simplify usage by supporting new default loop #260

Closed clue closed 3 years ago

clue commented 3 years ago

This changeset simplifies usage by supporting the new default loop.

// old (still supported)
$socket = new React\Socket\Server('127.0.0.1:8080', $loop);
$connector = new React\Socket\Connector($loop);

// new (using default loop)
$socket = new React\Socket\Server('127.0.0.1:8080');
$connector = new React\Socket\Connector();

Builds on top of https://github.com/reactphp/event-loop/pull/226, https://github.com/reactphp/event-loop/pull/229, https://github.com/reactphp/event-loop/pull/232, https://github.com/reactphp/stream/pull/159 and https://github.com/reactphp/dns/pull/182

clue commented 3 years ago

The first commit updates this to the currently unreleased EventLoop, Stream and DNS components to show how the new default loop can be used in this component (the build should be green). The second commit updates this to the releases that have yet to be tagged. This is expected to fail at the moment and should be green once the releases are tagged and the build is restarted.

This is ready for review. I will restart the build and merge once reviewed and the components are tagged.

clue commented 3 years ago

Restarted build and everyhing's green now that reactphp/event-loop v1.2.0, reactphp/stream v1.2.0 and reactphp/dns v1.8.0 have been released :shipit: