Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subchannels in DataChannels (dataProducer.send() method) #1151

Closed
ibc opened this issue Sep 7, 2023 · 1 comment · Fixed by #1152
Closed

Add subchannels in DataChannels (dataProducer.send() method) #1151

ibc opened this issue Sep 7, 2023 · 1 comment · Fixed by #1152
Assignees
Labels
Milestone

Comments

@ibc
Copy link
Member

ibc commented Sep 7, 2023

Mechanism to specify which DataConsumers should receive a message sent via dataProducer.send().

const dataConsumer = await transport.consumeData({
  [...],
  subchannels: [ 0, 2, 5 ]
});

const subchannels = dataConsumer.subchannels;
// => [ 0, 2, 5 ] (cloned array)

await dataConsumer.setSubchannels([ 1, 2, 5 ]);
// => Set(4) { 0, 2, 5, 4 }

const subchannels = dataConsumer.subchannels;
// => [ 1, 2, 5 ] (cloned array)

await dataConsumer.setSubchannels([]);
// => [] (cloned array)
// Send a message to all DataConsumers regardless their subchannels.
dataPoducer.send(
  message,
  /* ppid */
  undefined,
  /* subchannels */
  undefined,
  /* requiredSubchannel */
  undefined
);

// Send a message only to DataConsumers in subchannels 1 or 2.
dataPoducer.send(
  message,
  /* ppid */
  undefined,
  /* subchannels */
  [ 1, 2 ],
  /* requiredSubchannel */
  undefined
);

// Send a message only to DataConsumers in subchannels 1 or 2 but just 
// if also in subchannel 0.
dataPoducer.send(
  message,
  /* ppid */
  undefined,
  /* subchannels */
  [ 1, 2 ],
  /* requiredSubchannel */
  0
);
@ibc ibc added the feature label Sep 7, 2023
@ibc ibc added this to the v3 updates milestone Sep 7, 2023
@ibc ibc self-assigned this Sep 7, 2023
@ibc ibc mentioned this issue Sep 7, 2023
12 tasks
@jmillan
Copy link
Member

jmillan commented Nov 15, 2023

This is done long time ago.

@jmillan jmillan closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants