cabal-core
cabal-core copied to clipboard
reveal how many peers have received a message
Something like
core.publish({type:'chat/text', content: 'hello'}, function (err, msg, uploadListener) {
uploadListener.on('uploaded', function (peerKey) {
// update UI
})
})
This'd be ephemeral data, and so wouldn't be persisted to disk (unless we wanted to start doing that). It'd be enough for a short-lived indicator beside a message to show that it's been shared to some peers in the swarm.
oh i like this a lot! is it possible to do already or do we need to implement this in core?
(on phone in bed hehe)
On 13 Jun 2019, at 18:21, noffle [email protected] wrote:
Something like
core.publish({type:'chat/text', content: 'hello'}, function (err, msg, uploadListener) { uploadListener.on('uploaded', function (peerKey) { // update UI }) }) This'd be ephemeral data, and so wouldn't be persisted to disk (unless we wanted to start doing that). It'd be enough for a short-lived indicator beside a message to show that it's been shared to some peers in the swarm.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@cblgh: It needs to be implemented still. I think cabal-core would just, after publish but before calling its cb, get the seq# of the message it just wrote, and add an event listener on that hypercore for the 'upload' event.
@noffle ah yes great!
@substack's ACK pr for hypercore would be great for this https://github.com/mafintosh/hypercore/pull/215
https://github.com/mafintosh/hypercore/pull/215 has landed!! this is now possible to implement using the latest hypercore
W0000T this is great!! Thanks @cblgh, and thanks to @substack for the work on this.