Oops, missed stream protocol refactorings

This commit is contained in:
Tony Garnock-Jones 2019-06-03 14:28:02 +01:00
parent e457e270ba
commit e02c3ae715
1 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ spawn named 'rootServer' {
const server = Http.HttpServer(null, options.port);
during Http.Request($reqId, server, 'post', ['compile', $file], _, $reqSeal) spawn named reqId {
stop on retracted S.Readable(reqId);
stop on retracted S.Stream(reqId, S.Readable());
_collectSource.call(this, reqId, (source) => {
react {
const job = C.Compilation(file, source);
@ -74,8 +74,8 @@ spawn named 'rootServer' {
function _collectSource(streamId, cb) {
const chunks = [];
on message S.Data(streamId, $chunk) chunks.push(chunk);
on asserted S.End(streamId) {
on message S.Stream(streamId, S.Data($chunk)) chunks.push(chunk);
on asserted S.Stream(streamId, S.End()) {
const source = Bytes.concat(chunks).toString();
cb(source);
}