mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-24 16:32:32 +00:00
chore: make inboundStream a asyncIterable
This commit is contained in:
parent
5cb2025c2a
commit
5cfaf4128f
@ -24,6 +24,7 @@ const {
|
||||
/**
|
||||
* @typedef {any} Libp2p
|
||||
* @typedef {import('peer-id')} PeerId
|
||||
* @typedef {import('bl')} BufferList
|
||||
* @typedef {import('../stream-muxer/types').MuxedStream} MuxedStream
|
||||
* @typedef {import('../connection/connection')} Connection
|
||||
* @typedef {import('./message').RPC} RPC
|
||||
@ -339,7 +340,7 @@ class PubsubBaseProtocol extends EventEmitter {
|
||||
* Responsible for processing each RPC message received by other peers.
|
||||
*
|
||||
* @param {string} idB58Str - peer id string in base58
|
||||
* @param {MuxedStream} stream - inbound stream
|
||||
* @param {AsyncIterable<Uint8Array|BufferList>} stream - inbound stream
|
||||
* @param {PeerStreams} peerStreams - PubSub peer
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
|
@ -73,7 +73,7 @@ class PeerStreams extends EventEmitter {
|
||||
/**
|
||||
* Read stream
|
||||
*
|
||||
* @type {null|MuxedStream}
|
||||
* @type {null| AsyncIterable<Uint8Array>}
|
||||
*/
|
||||
this.inboundStream = null
|
||||
}
|
||||
@ -125,7 +125,6 @@ class PeerStreams extends EventEmitter {
|
||||
// - abortable, set to only return on abort, rather than throw
|
||||
// - transformed with length-prefix transform
|
||||
this._rawInboundStream = stream
|
||||
// @ts-ignore - abortable returns AsyncIterable and not a MuxedStream
|
||||
this.inboundStream = abortable(
|
||||
pipe(
|
||||
this._rawInboundStream,
|
||||
|
Loading…
x
Reference in New Issue
Block a user