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

feat: implement streams #49

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

o-rumiantsev
Copy link
Owner

Closes: #42

@o-rumiantsev o-rumiantsev added the enhancement New feature or request label Dec 31, 2018
@o-rumiantsev o-rumiantsev self-assigned this Dec 31, 2018
@o-rumiantsev
Copy link
Owner Author

I have added some changes to Connection class:

  • Add property streams, which is a Map streamId => stream
  • Add property streamPools, which is a Map streamId => { next, chunksPool }, where next is a number which defines an order of next expected chunk to pass to stream, and chunksPool is a Map order => buffer, where order is a number which defines buffer emit order
  • Add method stream(readable, callback), which takes readable stream, and redirects it to network
  • Add internal method processStream(message), which takes connection message containing stream id
  • Add internal method inspectChunksPool(pool, stream, order, buffer), where pool is a pool related to stream, order is a number which defines buffer emit order

@o-rumiantsev
Copy link
Owner Author

Changes introduced to watchers:

  • Replace reading file with creating read stream
  • Emit stream instead of data

@o-rumiantsev o-rumiantsev changed the title WIP: feat: implement streams feat: implement streams Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant