I'm a software engineer with a focus on P2P, Node.js, React, Blockchain and Electron.
Currently I'm creating Filecoin Station (desktop app) and Meridian (decentralized impact evaluator) at Protocol Labs.
The async stream spec
I'm a software engineer with a focus on P2P, Node.js, React, Blockchain and Electron.
Currently I'm creating Filecoin Station (desktop app) and Meridian (decentralized impact evaluator) at Protocol Labs.
Could totally be misunderstanding but what you mean by this (specifically the bolded part)?
A generator stream is simply a generator function. If you're familiar with other stream semantics: There's only readable streams, no need for writable and transform.
for working with pushing sources.
function wrap(emitter, event){
var queue = new Queue;
emitter.on(event, queue.push);
return function*(end){
if (!end) return yield queue.next;
};
}
var read = wrap(emitter, 'data');
while (true) console.log(yield read());
suggested by @dominictarr, https://github.com/dominictarr/pull-cat
function cat(streams){
var idx = 0;
return function*(end){
if (end) return streams[idx](end);
var data;
while (!data && streams[idx]) {
try {
// read
data = yield streams[idx]();
} catch (err) {
// clean up
streams.slice(idx).forEach(function(stream){
try { yield stream(true) } catch (_) {}
});
}
if (!data) idx++;
}
return data;
};
}
@Raynos can you please explain what kind of async streaming is missing?
function(){
return function*(){
return yield fs.readFile(nextLog)
}
}
@Raynos can you explain what you mean by "missing abort"?
We have ending streams by calling yield fn(true)
l
the former allows you to pass errors to generator runner without going throw the exception system.
This works cleanly with raynos/gens and Agen spec
excellent idea by @dominictarr.
compare with:
say, a merge stream,
that takes N sorted streams and merges them into one stream?
(it would pull from each stream, but output chunks in correct order -
for example, to do a merge sort, or LSMT compaction)
A simpler one would just to merge multiple streams into one, but not control the order.
Looking to do the following:
Basically wondering how to pull off step 3, without waiting for all the contents to be read in the map
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.