Skip to content

Expecting exactly one acknowledgment when broadcasting with timeout #5062

Discussion options

You must be logged in to vote

Hi! No, this is not currently possible, the server waits for all clients before calling the callback method.

I guess we could indeed provide a way to iterate over the acks as they come, maybe something like this:

try {
  for await (const ack of io.timeout(1000).emitWithAck("event")) {
    console.log(ack);
  }
} catch (e) {
  // timeout
}

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@darrachequesne
Comment options

@giovanni-bertoncelli
Comment options

@darrachequesne
Comment options

@giovanni-bertoncelli
Comment options

@giovanni-bertoncelli
Comment options

Answer selected by darrachequesne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants