Skip to content

Await/Promise for receiving next message feature discussion #40

@cameronelliott

Description

@cameronelliott

This is the 2nd feature I would like to discuss adding to the library.

Which is also a feature request for an excellent raw websockets library.

The feature is described here

Basically, it allows promises to be used to await the next message received, rather than just relying on a callback.

Example from linked issue:

await ws.open();

while (true) {
  data = await ws.recv();
  ws.send(data);
}

See discussion in raw websockets project for more details: here

I make try to implement this, but I am not a fantastic JS, nor promises programmer, but if someone else
wants to help or try to do this, please let me know!

Thanks for this awesome async/MQTT library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions