Oops, missed stream protocol refactorings
This commit is contained in:
parent
e457e270ba
commit
e02c3ae715
|
@ -56,7 +56,7 @@ spawn named 'rootServer' {
|
||||||
|
|
||||||
const server = Http.HttpServer(null, options.port);
|
const server = Http.HttpServer(null, options.port);
|
||||||
during Http.Request($reqId, server, 'post', ['compile', $file], _, $reqSeal) spawn named reqId {
|
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) => {
|
_collectSource.call(this, reqId, (source) => {
|
||||||
react {
|
react {
|
||||||
const job = C.Compilation(file, source);
|
const job = C.Compilation(file, source);
|
||||||
|
@ -74,8 +74,8 @@ spawn named 'rootServer' {
|
||||||
|
|
||||||
function _collectSource(streamId, cb) {
|
function _collectSource(streamId, cb) {
|
||||||
const chunks = [];
|
const chunks = [];
|
||||||
on message S.Data(streamId, $chunk) chunks.push(chunk);
|
on message S.Stream(streamId, S.Data($chunk)) chunks.push(chunk);
|
||||||
on asserted S.End(streamId) {
|
on asserted S.Stream(streamId, S.End()) {
|
||||||
const source = Bytes.concat(chunks).toString();
|
const source = Bytes.concat(chunks).toString();
|
||||||
cb(source);
|
cb(source);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue