This is a feature request. Well, more of a stylistic request.
Paramikojs performs network processes in an entirely async environment. This leads to lots of callbacks everywhere. A lot of this would shortened for readability by the use of promises. The key feature is that the promises/A+ spec declares that promises chain, which means individual steps of an asynchronous process do not need to be hardcoded in what to call next. I recently solved another networking problem--implementing SOCKS5--elegantly with promises. If you put your thumb over all the .then()s, that _connect() reads like a synchronous subroutine.
I can't speak for everyone, but I would find the API would be easier to use if I could ask for promises instead of needing to pass in callbacks.
This would require a large overhaul of some code that you are probably a bit tired of, but I wanted to bring the option to your attention.
This is a feature request. Well, more of a stylistic request.
Paramikojs performs network processes in an entirely async environment. This leads to lots of callbacks everywhere. A lot of this would shortened for readability by the use of promises. The key feature is that the promises/A+ spec declares that promises chain, which means individual steps of an asynchronous process do not need to be hardcoded in what to call next. I recently solved another networking problem--implementing SOCKS5--elegantly with promises. If you put your thumb over all the
.then()
s, that_connect()
reads like a synchronous subroutine.I can't speak for everyone, but I would find the API would be easier to use if I could ask for promises instead of needing to pass in callbacks.
This would require a large overhaul of some code that you are probably a bit tired of, but I wanted to bring the option to your attention.