Closed thisismydesign closed 6 years ago
How would there be a synchronous version? Each exchange requires a request to be made with a callback function. Instead of using callback functions, I made every request follow the promise structure. If you use ES6 then you can use the async / await
feature to make the requests synchronous.
Coming from a different background I didn't realize this is standard practice in JS. Sorry to bother you with this.
No problem. I would like to make this in Python as well but that's a big rewrite for the time being. I would take a look at the async / await
ES6 feature tho
Will definitely do so, thanks. In the meanwhile I got comfortable with this style but I still think it has some overhead - at least code-wise.
Regarding the choice of language: I actually think JS is a great choice as nowadays it's very popular for creating simple webservices. Along these lines Ruby would be another good choice IMO. Python is great for scientific stuff (say creating a trading bot) but it's probably a good idea to decouple that from the service providing the data. Is the reason for porting simply to make it more accessible or do you have some specific use case in mind?
Thanks for this, it's a great project.
My only concern is with the use of promises. It'd be easy to use this lib asynchronously if the API would be synchronous but the other way around is not possible unfortunately. In other words using promises forces a style that some might want to avoid while it would be trivial to introduce it by the user if needed.
Would it be possible for you to release a synchronous API?