KaymeKaydex / go-vshard-router

go vshard-router implementation for tarantool
MIT License
21 stars 3 forks source link

Simplify `RouterMapCallRWImpl`: don't use errgroup #46

Closed nurzhan-saktaganov closed 3 months ago

nurzhan-saktaganov commented 3 months ago

Since replicaset.conn.Do returns future, we can send a bunch of requests and wait for their responses in the same goroutine. No errgroup, channels and workers are needed. It can significantly simplify RouterMapCallRWImpl.

See the lua implementation as a reference: https://github.com/tarantool/vshard/blob/9fc976daa04d6435a258cac91d9d7cf3ddcdc5cc/vshard/router/init.lua#L803

nurzhan-saktaganov commented 3 months ago

PR to resolve this issue: #47