Skip to content

Use promises #7

@kousu

Description

@kousu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions