steem-js
steem-js copied to clipboard
Added stream functions to README.md in docs
Added the following functions to the documentation:
- streamBlockNumber
- streamBlock
- streamTransactions
- streamOperations
I was unaware that a steem node could do this, so upon digging a bit deeper I found that I seem to be correct, and basically all streamBlock() does is repeatedly poll the server for the latest block. While not ideal, it's still the only way to really do it at this point.
HOWEVER, watch the websocket connection frames after you call one of these functions...
steem.api.streamBlock('head', function(err, result) {
console.log(err, result);
});
The way these functions are implemented, they're basically machine-gunning the requests so fast it'll make your head spin. There really should be a timer implemented in these functions so that at least they don't check more than once every second or so for the latest blocks to become available.
You're right about how it works, it's not technically streaming. Nevertheless the functions exist but are undocumented so I sought to fix that is all.