Skip to content

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

Merged
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:connector-signature
Jul 28, 2021
Merged

Update Connector signature to take $context as first argument#264
WyriHaximus merged 1 commit into
reactphp:masterfrom
clue-labs:connector-signature

Conversation

@clue

@clueclue commented Jul 27, 2021

Copy link
Copy Markdown
Member

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

// unchanged$connector = newReact\Socket\Connector();
// deprecated$connector = newReact\Socket\Connector(null, $context);
$connector = newReact\Socket\Connector($loop, $context);
// new$connector = newReact\Socket\Connector($context);
$connector = newReact\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

@clueclue added this to the v1.9.0 milestone Jul 27, 2021
@clue
clueforce-pushed the connector-signature branch 2 times, most recently from 869ba91 to 617ced0CompareJuly 27, 2021 14:08
@clue
clue requested a review from WyriHaximusJuly 27, 2021 14:17
@WyriHaximus
WyriHaximus merged commit c85158a into reactphp:masterJul 28, 2021
@clue
clue deleted the connector-signature branch July 28, 2021 20:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@clue@WyriHaximus