Skip to content
This repository was archived by the owner on Feb 9, 2020. It is now read-only.
This repository was archived by the owner on Feb 9, 2020. It is now read-only.

Implement an optional promise based interface #33

@brhx

Description

@brhx

I don't know how possible this would be, because I can't remember if anything is returned after running something like serf.members(cb). it would be great to have the option of doing both of the following as if nothing is returned it wouldn't break the existing API (obviously this wouldn't work for the streams):

Standard

serf.members((err, members) => {
    console.log(members);
});

With promises method

serf.members()
.then(members => {
    console.log(members);
})
.catch(err => {
    throw err;
});

With await/async

let members = await serf.members();

Is this something that would relatively easy to implement or is it architecturally a bit of a pain?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions