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

Update Connector signature to take $context as first argument #264

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

clue
Copy link
Member

@clue clue commented Jul 27, 2021

This changeset updates the Connector signature to take the $context as first argument.

// unchanged
$connector = new React\Socket\Connector();

// deprecated
$connector = new React\Socket\Connector(null, $context);
$connector = new React\Socket\Connector($loop, $context);

// new
$connector = new React\Socket\Connector($context);
$connector = new React\Socket\Connector($context, $loop);

The new signature has been added to match the new SocketServer and consistently move the now commonly unneeded loop argument to the last argument. The previous signature has been deprecated and should not be used anymore. In its most basic form, both signatures are compatible. Existing code continues to work as-is.

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

@clue clue added this to the v1.9.0 milestone Jul 27, 2021
@clue clue force-pushed the connector-signature branch 2 times, most recently from 869ba91 to 617ced0 Compare July 27, 2021 14:08
@clue clue requested a review from WyriHaximus July 27, 2021 14:17
@WyriHaximus WyriHaximus merged commit c85158a into reactphp:master Jul 28, 2021
@clue clue deleted the connector-signature branch July 28, 2021 20:00
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