-
Notifications
You must be signed in to change notification settings - Fork 3
Add CallAsync analogue without a context #62
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
Comments
Workaround is use
But it is really very strange. |
@oleg-jukovec you mean go-tarantool creates a goroutine for request if there is a non-nil context? |
Yes, I am. |
Does using the Pooler() method solve your issue? go-vshard-router/replicaset.go Lines 69 to 71 in 8c23952
|
The context usage:
go-vshard-router/replicaset.go
Line 168 in bdd3ef5
leads to creating a goroutine for each request. It's very expensive (especially in context.Background() case). A faster way is to rely on setting a timeout on the entire connection with tarantool.Opts.Timeout:
https://github.com/tarantool/go-tarantool/blob/c0a8ad307468471132652fb3829525b813762bc7/connection.go#L281-L292
So there is should be something like (need to think about naming):
I would suggest adapting the request logic from the Go connector in the v3 library. This logic with FooAsync, FooTyped, FooWithContext, FooWithoutContextAsync it only seems simple, but in fact it is hard to maintain all this stuff.
The text was updated successfully, but these errors were encountered: