Comments (3)
Hi Adrian, nice to hear from you again!
I can see where you're coming from. I'm kind of reinventing the wheel here, but there are good reasons for it. I may consider making the API compatible with Node in the future. Currently, EventEmitter
has the same API as Node's. The reason streams are different is several-fold. One, there's no need for read and write streams as we're not doing filesystem stuff. The UI focus also needs me to have a start
event in addition to Node's data
(update
) and end
events. I've also gone for subscribe
over pipe
, which is a difference of "pull" versus "push" and has some performance advantages. For one, there's no need for backpressure logic. But I may support pipe
in the future as there are use cases for it. It would definitely be a huge win to be able to piggy-back off the node ecosystem.
Do you know of data-agnostic libraries that use Node streams? I haven't done much research here.
from samsara.
Well. for each point.
- node streams are specialised event emitters, so i'd recommend starting out by just using the event emitter as a base to begin with.
- the read/write distinction is a valid concern, but the majority of streams you deal with end up being Transform/through streams or Duplex streams. Which can both be read and written from.
- While not called start, there is a 'readable' event which gets fired when a stream starts.
- Custom stream implementations are completely free to add additional events to emit.
- Node streams can be both push or pull streams.
Well, I guess it depends on what you mean by "data agnostic". All node streams don't particularly care about what you are streaming through them. The biggest distinction is whether they are running in binary/text, or in objectMode.
You should probably check out highlandjs, which is by the guy who wrote the async.js library. My favorite part of it is that you can use promises, callbacks and generators directly. It is not exactly compatible with node streams tho.
If you wanna chat about this stuff sometime, i'd be open to it. My interest in famous came about because I was looking to use it in a stream-oriented architecture as part of my graft project, so i've done a lot of research on the subject.
from samsara.
As this is not an issue with the code itself, I'd prefer it be raised in the google group: groups.google.com/forum/#!forum/samsarajs
Feel free to repost there!
from samsara.
Related Issues (20)
- Not responsive to split view on iOS HOT 4
- [Question] Min & Max Opacity HOT 8
- EventEmitter incorrectly binds owner on `once`
- EventHandler never turns off upstream events HOT 1
- [Question] will-change size HOT 2
- [Question] How to populate the div within a Surface using Javascript HOT 8
- React Native HOT 3
- Manipulating StyleSheets instead of inline styles HOT 4
- Views added to context after context has been mounted need a resize event to be render HOT 2
- Question : Can Samsara leverage the capabilities of shadow-dom ?? HOT 1
- FYI - FastDom HOT 1
- SequentialLayout can't be align to bottom HOT 7
- Scrollview.goTo(x) goes bananas on iOS HOT 6
- Paginated Scrollview can't handle resize/orientation change HOT 1
- Scrollview bug IE11
- set/toggle/remove classes bug
- Awesome work HOT 2
- Non-nested CSS3D seems to be getting bad in Chrome. HOT 5
- Is Samsara viable when implementing animations designed in Framer? HOT 1
- misalignment with Cube demo HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samsara.