go-sonic
go-sonic copied to clipboard
Bulk functions not work as expected with more than 1 goroutines
As referenced in the issue #9 the bulk function are stuck when using multiple goroutines.
The reason why I have created a bulk function is to dispatch work among multiple goroutines. If this goal is subject to unexpected behavior this code should be refactored to work properly.
An idea is to give access to a pool of connection by default.
Currently the driver use one connections per instance of Ingester/Search... So this is impossible to execute the Push function across multiple goroutines for the same instance.
If an instance have a pool of connections: that will solve the above problem. In addition all bulk functions would be trivial to implement.
Implementing a pool like that https://github.com/fatih/pool should be sufficient for all usages. Maybe adding an dynamic increase/decrease of the number of available connections.