wisespace-io / binance-rs

Rust Library for the Binance API
Other
665 stars 297 forks source link

Simplify the websocket implementation to use a single callback #22

Closed allada closed 5 years ago

allada commented 5 years ago

Instead of using a delegate-style system, this patch moves to use a callback-event-like system. This simplifies the code for the consumer and implementation. This will allow multi-threaded systems much easier by giving a single point where a consumer could plum the calls out of the websocket API up to another thread.

allada commented 5 years ago

Note that this PR has another PR on it. I was lazy and decided not to split it up.

I was experimenting with different designs and this is the final one that seemed most natural and easiest to work with.

wisespace-io commented 5 years ago

It seems a good improvement, I will check it better when I get some time.