-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add connect context arg to Connection::connect() #82
Conversation
Looks good to me. I didn't check for postgres, maybe it's the same problem there? Can you also add a test? |
src/TimeoutConnector.php
Outdated
@@ -30,14 +29,6 @@ public function __construct(int $timeout = self::DEFAULT_TIMEOUT) | |||
*/ | |||
public function connect(SqlConnectionConfig $config): Promise | |||
{ | |||
if (!$config instanceof ConnectionConfig) { | |||
throw new \TypeError(\sprintf("Must provide an instance of %s to MySQL connectors", ConnectionConfig::class)); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have been dropped I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was a little overzealous with the delete key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous way should have worked, too. If the cancellation doesn't cancel, then there's another bug.
@kelunik @prolic I don't think this is a problem in postgres since that library uses loop watchers for connection due to how the extensions work. |
Shouldn't TimeoutConnector gain that new context arg as well? |
Potentially, but I think it would be better to add another class such as |
Any reason why this has not been merged? |
Addresses #81.