webcerebrium / java-binance-api

Java Binance API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ThreadSafe implementation of balances

PetteriPertola opened this issue · comments

Hi,

The current implementation of BinanceApi.balancesMap() is not thread safe as you are using a HashMap. Is it possible to change it to ConcurrentHashMap? Even though my call to getting the balances is single-threaded, the resulting map is used in a multithreaded application.

Using version 1.0.3.

Great job with the client, very intuitive and easy to use.

thanks for a feedback, probably it makes sense.
Will be releasing 1.0.6 this week with that in mind

Sounds great, please notify here when that happens so I'll update to the latest version. Right now I have a workaround by just copying the map to a concurrent map but it's not exactly an efficient way to do it :-)

@PetteriPertola feel free to take release 1.0.6, with this update, it should be already available as maven central dependency:
http://repo1.maven.org/maven2/com/webcerebrium/binance-api/

Thanks a lot.