Skip to content

Feature proposal - $client->send() - return a Promise #32

@FGIKCM

Description

@FGIKCM

For now, there is no way with the client to send data, THEN close the stream when everything is sent. The $client->send('message) is not in a Promise, so doing the following will not (always) work, as the stream may be closed before everything is sent:

$client->send('chain1');
$client->send('chain2');
$client->close();

Should it be possible to have a similar function, which would returns a Promise? This way, we would have a clean way to send messages, THEN closing the stream.
For example:

$client->sendInPromise('chain1chain 2')->then(function() use ($client) {$client->close()});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions