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

feature request: asynchronous validate function #44

Closed
joseph349 opened this issue Feb 6, 2020 · 9 comments
Closed

feature request: asynchronous validate function #44

joseph349 opened this issue Feb 6, 2020 · 9 comments

Comments

@joseph349
Copy link

joseph349 commented Feb 6, 2020

I am using knex 0.15.2 along with tarn 1.1.4.
Have been getting the "This socket has been ended by the other party." recently when trying to use a connection that has been closed or redirected by the server.
We have found that we may be able to avoid this error by pinging the connection in the validation function.
Problem we're having is that the validation function is synchronous and there is no way for it to wait for the ping promise to resolve.
Can we have the validate function resolve async functions?

@elhigu
Copy link
Collaborator

elhigu commented Feb 7, 2020

I thought it already was async, but looks like it is actually not. I'll fix this for the next release.

@joseph349
Copy link
Author

Is the work is already done? Is there a branch that we can use?

@elhigu
Copy link
Collaborator

elhigu commented Feb 7, 2020

No. I just started to look into it. But it doesn't seem to be completely trivial to implement, so it might take some time.

@elhigu
Copy link
Collaborator

elhigu commented Feb 10, 2020

This is actually pretty fundamental change and will need major release (strictly speaking it is not breaking change, but internal acquire behaviour changes significantly so better to do full release for this).

@elhigu
Copy link
Collaborator

elhigu commented Feb 27, 2020

PR #45

@joseph349
Copy link
Author

Has this been published to npm?

@elhigu
Copy link
Collaborator

elhigu commented Mar 18, 2020

not yet, I'll make a release when I have time

@eugene1g
Copy link

Looks like this feature has been shipped in v3.0 @ b577cfc

@elhigu
Copy link
Collaborator

elhigu commented May 23, 2020

true

@elhigu elhigu closed this as completed May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants