Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

fix!: emit uint8arraylists for data #201

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Aug 6, 2022

To make sure there's no chance we end up copying memory to a new
location only to pass it to a stream handler, return Uint8ArrayLists
for the data property of multiplexed messages.

The stream interface looks like this:

Stream extends Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>

That is, it's a Duplex whose source emits Uint8ArrayLists but the
sink can accept Uint8ArrayLists or Uint8Arrays.

Depends on:

BREAKING CHANGE: mulitplexed streams now emit Uint8ArrayLists and not Uint8Arrays to handle the case for when transports have smaller chunk sizes than the multiplexer

To make sure there's no chance we end up copying memory to a new
location only to pass it to a stream handler, return `Uint8ArrayList`s
for the `data` property of multiplexed messages.

The stream interface looks like this:

```
Stream extends Duplex<Uint8ArrayList, Uint8ArrayList | Uint8Array>
```

That is, it's a Duplex whose source emits `Uint8ArrayList`s but the
sink can accept `Uint8ArrayList`s or `Uint8Arrays`.

Depends on:

- [ ] libp2p/js-libp2p-interfaces#279
@achingbrain achingbrain marked this pull request as draft August 6, 2022 17:21
@achingbrain achingbrain marked this pull request as ready for review August 10, 2022 10:30
@achingbrain achingbrain merged commit e85ebab into master Aug 10, 2022
@achingbrain achingbrain deleted the fix/emit-uint8arraylists-for-data branch August 10, 2022 10:37
github-actions bot pushed a commit that referenced this pull request Aug 10, 2022
## [5.0.0](v4.0.3...v5.0.0) (2022-08-10)

### ⚠ BREAKING CHANGES

* mulitplexed streams now emit `Uint8ArrayList`s and not `Uint8Array`s to handle the case for when transports have smaller chunk sizes than the multiplexer

### Bug Fixes

* emit uint8arraylists for data ([#201](#201)) ([e85ebab](e85ebab))
@github-actions
Copy link

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant