@syndicate-lang/driver-mdns
Advanced tools
Comparing version 0.2.7 to 0.2.8
1089
lib/index.js
@@ -75,354 +75,419 @@ "use strict"; | ||
_Dataspace.spawn('driver/avahi-publish', function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn = _Syndicate.Observe(Observe(Published(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
{ | ||
var _facets2 = _Syndicate.Map(); | ||
var _handler = { | ||
skeleton: [Observe.constructorInfo, [Published.constructorInfo, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([0, 2]), _Syndicate.fromJS([0, 3])]), | ||
assertion: _assn, | ||
callback: _Dataspace.wrap(function (_evt, _vs) { | ||
if (_evt === _Skeleton.EVENT_ADDED) { | ||
var _svc = _vs.get(0); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn = _Syndicate.Observe(Observe(Published(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
var _hostName = _vs.get(1); | ||
var _handler = { | ||
skeleton: [Observe.constructorInfo, [Published.constructorInfo, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([0, 2]), _Syndicate.fromJS([0, 3])]), | ||
assertion: _assn, | ||
callback: _Dataspace.wrap(function (_evt, _vs) { | ||
if (_evt === _Skeleton.EVENT_ADDED) { | ||
var _svc = _vs.get(0); | ||
var _port = _vs.get(2); | ||
var _hostName = _vs.get(1); | ||
var _txtDataRecords = _vs.get(3); | ||
var _port = _vs.get(2); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c23 = Observe(Published(_svc, _hostName, _port, _txtDataRecords)); | ||
var _txtDataRecords = _vs.get(3); | ||
var _assn2 = _Syndicate.Observe(_c23); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets2 = _facets2.set(_Syndicate.fromJS([_svc, _hostName, _port, _txtDataRecords]), _Dataspace._currentFacet); | ||
var _handler2 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c23]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn2, | ||
callback: _Dataspace.wrap(function (_evt2, _vs2) { | ||
if (_evt2 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn2, _handler2]; | ||
}, false); | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
{ | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [Publish(_svc, _hostName, _port, _txtDataRecords), null]; | ||
}, true); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn, _handler]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn2 = _Syndicate.Observe(Observe(Published(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
var _handler2 = { | ||
skeleton: [Observe.constructorInfo, [Published.constructorInfo, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([0, 2]), _Syndicate.fromJS([0, 3])]), | ||
assertion: _assn2, | ||
callback: _Dataspace.wrap(function (_evt2, _vs2) { | ||
if (_evt2 === _Skeleton.EVENT_REMOVED) { | ||
var _svc2 = _vs2.get(0); | ||
var _hostName2 = _vs2.get(1); | ||
var _port2 = _vs2.get(2); | ||
var _txtDataRecords2 = _vs2.get(3); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [Publish(_svc, _hostName, _port, _txtDataRecords), null]; | ||
}, true); | ||
var _key2 = _Syndicate.fromJS([_svc2, _hostName2, _port2, _txtDataRecords2]); | ||
_facets2.get(_key2).stop(); | ||
_facets2 = _facets2.remove(_key2); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn, _handler]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn2, _handler2]; | ||
}, true); | ||
} | ||
{ | ||
var _facets4 = _Syndicate.Map(); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn3 = _Syndicate.Observe(Publish(_Syndicate.Capture(Service(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn3 = _Syndicate.Observe(Publish(_Syndicate.Capture(Service(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _handler3 = { | ||
skeleton: [Publish.constructorInfo, [Service.constructorInfo, null, null], null, null, null], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([1]), _Syndicate.fromJS([2]), _Syndicate.fromJS([3])]), | ||
assertion: _assn3, | ||
callback: _Dataspace.wrap(function (_evt3, _vs3) { | ||
if (_evt3 === _Skeleton.EVENT_ADDED) { | ||
var _svc2 = _vs3.get(0); | ||
var _handler3 = { | ||
skeleton: [Publish.constructorInfo, [Service.constructorInfo, null, null], null, null, null], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([1]), _Syndicate.fromJS([2]), _Syndicate.fromJS([3])]), | ||
assertion: _assn3, | ||
callback: _Dataspace.wrap(function (_evt3, _vs3) { | ||
if (_evt3 === _Skeleton.EVENT_ADDED) { | ||
var _svc3 = _vs3.get(0); | ||
var _name = _vs3.get(1); | ||
var _name = _vs3.get(1); | ||
var _serviceType = _vs3.get(2); | ||
var _serviceType = _vs3.get(2); | ||
var _hostName2 = _vs3.get(3); | ||
var _hostName3 = _vs3.get(3); | ||
var _port2 = _vs3.get(4); | ||
var _port3 = _vs3.get(4); | ||
var _txtDataRecords2 = _vs3.get(5); | ||
var _txtDataRecords3 = _vs3.get(5); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c25 = Publish(_svc2, _hostName2, _port2, _txtDataRecords2); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets4 = _facets4.set(_Syndicate.fromJS([_svc3, _name, _serviceType, _hostName3, _port3, _txtDataRecords3]), _Dataspace._currentFacet); | ||
var _assn4 = _Syndicate.Observe(_c25); | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
var _handler4 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c25]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn4, | ||
callback: _Dataspace.wrap(function (_evt4, _vs4) { | ||
if (_evt4 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn4, _handler4]; | ||
}, false); | ||
{ | ||
var topFacet = currentFacet(); | ||
var args = ['-f', '-s']; | ||
if (_hostName3 !== null) args.push('-H', _hostName3); | ||
args.push(_name, _serviceType, _port3.toString()); | ||
{ | ||
var topFacet = currentFacet(); | ||
var args = ['-f', '-s']; | ||
if (_hostName2 !== null) args.push('-H', _hostName2); | ||
args.push(_name, _serviceType, _port2.toString()); | ||
_txtDataRecords3.forEach(function (txt) { | ||
return args.push(txt); | ||
}); | ||
_txtDataRecords2.forEach(function (txt) { | ||
return args.push(txt); | ||
}); | ||
var id = genUuid('avahi-publish'); | ||
var id = genUuid('avahi-publish'); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [S.Subprocess(id, 'avahi-publish', args, { | ||
stdio: ['ignore', 'ignore', 'pipe'] | ||
}), null]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [S.Subprocess(id, 'avahi-publish', args, { | ||
stdio: ['ignore', 'ignore', 'pipe'] | ||
}), null]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c22 = id; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c26 = id; | ||
var _assn4 = _Syndicate.Observe(S.SubprocessError(_c22, _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _assn5 = _Syndicate.Observe(S.SubprocessError(_c26, _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _handler4 = { | ||
skeleton: [S.SubprocessError.constructorInfo, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c22]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn4, | ||
callback: _Dataspace.wrap(function (_evt4, _vs4) { | ||
if (_evt4 === _Skeleton.EVENT_MESSAGE) { | ||
var _err = _vs4.get(0); | ||
var _handler5 = { | ||
skeleton: [S.SubprocessError.constructorInfo, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c26]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn5, | ||
callback: _Dataspace.wrap(function (_evt5, _vs5) { | ||
if (_evt5 === _Skeleton.EVENT_MESSAGE) { | ||
var _err = _vs5.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
{ | ||
console.error("Couldn't start avahi-publish", _err); | ||
} | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn4, _handler4]; | ||
}, true); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
{ | ||
console.error("Couldn't start avahi-publish", _err); | ||
} | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c23 = id; | ||
var _assn5 = _Syndicate.Observe(S.SubprocessExit(_c23, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance)); | ||
var _handler5 = { | ||
skeleton: [S.SubprocessExit.constructorInfo, null, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c23]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn5, | ||
callback: _Dataspace.wrap(function (_evt5, _vs5) { | ||
if (_evt5 === _Skeleton.EVENT_ADDED) { | ||
var _code = _vs5.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
{ | ||
console.error("Subprocess avahi-publish terminated with code", _code); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn5, _handler5]; | ||
}, true); | ||
} | ||
}) | ||
}; | ||
return [_assn5, _handler5]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c27 = id; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c24 = id; | ||
var _assn6 = _Syndicate.Observe(S.SubprocessExit(_c27, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance)); | ||
var _assn6 = _Syndicate.Observe(S.SubprocessRunning(_c24, _Syndicate.Discard._instance, [_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
var _handler6 = { | ||
skeleton: [S.SubprocessExit.constructorInfo, null, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c27]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn6, | ||
callback: _Dataspace.wrap(function (_evt6, _vs6) { | ||
if (_evt6 === _Skeleton.EVENT_ADDED) { | ||
var _code = _vs6.get(0); | ||
var _handler6 = { | ||
skeleton: [S.SubprocessRunning.constructorInfo, null, null, [3, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c24]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([2, 2])]), | ||
assertion: _assn6, | ||
callback: _Dataspace.wrap(function (_evt6, _vs6) { | ||
if (_evt6 === _Skeleton.EVENT_ADDED) { | ||
var _stderr = _vs6.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
console.error("Subprocess avahi-publish terminated with code", _code); | ||
} | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn6, _handler6]; | ||
}, true); | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace.declareField(this, "established", false); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c28 = id; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return this.established ? [Published(_svc3, _hostName3, _port3, _txtDataRecords3), null] : [void 0, null]; | ||
}, true); | ||
var _assn7 = _Syndicate.Observe(S.SubprocessRunning(_c28, _Syndicate.Discard._instance, [_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c25 = S.Stream(_stderr, S.Readable()); | ||
var _handler7 = { | ||
skeleton: [S.SubprocessRunning.constructorInfo, null, null, [3, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c28]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([2, 2])]), | ||
assertion: _assn7, | ||
callback: _Dataspace.wrap(function (_evt7, _vs7) { | ||
if (_evt7 === _Skeleton.EVENT_ADDED) { | ||
var _stderr = _vs7.get(0); | ||
var _assn7 = _Syndicate.Observe(_c25); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace.declareField(this, "established", false); | ||
var _handler7 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c25]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn7, | ||
callback: _Dataspace.wrap(function (_evt7, _vs7) { | ||
if (_evt7 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
topFacet.stop(); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn7, _handler7]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return this.established ? [Published(_svc2, _hostName2, _port2, _txtDataRecords2), null] : [void 0, null]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _this = this; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c29 = S.Stream(_stderr, S.Readable()); | ||
var _c26 = _stderr; | ||
var _assn8 = _Syndicate.Observe(_c29); | ||
var _assn8 = _Syndicate.Observe(S.Stream(_c26, S.Line(_Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
var _handler8 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c29]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn8, | ||
callback: _Dataspace.wrap(function (_evt8, _vs8) { | ||
if (_evt8 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
topFacet.stop(); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn8, _handler8]; | ||
var _handler8 = { | ||
skeleton: [S.Stream.constructorInfo, null, [S.Line.constructorInfo, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c26]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 0])]), | ||
assertion: _assn8, | ||
callback: _Dataspace.wrap(function (_evt8, _vs8) { | ||
if (_evt8 === _Skeleton.EVENT_MESSAGE) { | ||
var _line = _vs8.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_line = _line.fromUtf8(); | ||
if (_line.startsWith('Established')) { | ||
_this.established = true; | ||
} else if (_line.startsWith('Disconnected')) { | ||
_this.established = false; | ||
} else if (_line.startsWith('Got SIG')) {// e.g. "Got SIGTERM, quitting."; ignore. | ||
} else { | ||
console.log('avahi-publish', _name + ':', _line); | ||
} | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn8, _handler8]; | ||
}, true); | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn6, _handler6]; | ||
}, true); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn3, _handler3]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _this = this; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn9 = _Syndicate.Observe(Publish(_Syndicate.Capture(Service(_Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _c30 = _stderr; | ||
var _handler9 = { | ||
skeleton: [Publish.constructorInfo, [Service.constructorInfo, null, null], null, null, null], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([0, 0]), _Syndicate.fromJS([0, 1]), _Syndicate.fromJS([1]), _Syndicate.fromJS([2]), _Syndicate.fromJS([3])]), | ||
assertion: _assn9, | ||
callback: _Dataspace.wrap(function (_evt9, _vs9) { | ||
if (_evt9 === _Skeleton.EVENT_REMOVED) { | ||
var _svc4 = _vs9.get(0); | ||
var _assn9 = _Syndicate.Observe(S.Stream(_c30, S.Line(_Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
var _name2 = _vs9.get(1); | ||
var _handler9 = { | ||
skeleton: [S.Stream.constructorInfo, null, [S.Line.constructorInfo, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c30]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 0])]), | ||
assertion: _assn9, | ||
callback: _Dataspace.wrap(function (_evt9, _vs9) { | ||
if (_evt9 === _Skeleton.EVENT_MESSAGE) { | ||
var _line = _vs9.get(0); | ||
var _serviceType2 = _vs9.get(2); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_line = _line.fromUtf8(); | ||
var _hostName4 = _vs9.get(3); | ||
if (_line.startsWith('Established')) { | ||
_this.established = true; | ||
} else if (_line.startsWith('Disconnected')) { | ||
_this.established = false; | ||
} else if (_line.startsWith('Got SIG')) {// e.g. "Got SIGTERM, quitting."; ignore. | ||
} else { | ||
console.log('avahi-publish', _name + ':', _line); | ||
} | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn9, _handler9]; | ||
}, true); | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn7, _handler7]; | ||
}, true); | ||
var _port4 = _vs9.get(4); | ||
var _txtDataRecords4 = _vs9.get(5); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var _key4 = _Syndicate.fromJS([_svc4, _name2, _serviceType2, _hostName4, _port4, _txtDataRecords4]); | ||
_facets4.get(_key4).stop(); | ||
_facets4 = _facets4.remove(_key4); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn3, _handler3]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn9, _handler9]; | ||
}, true); | ||
} | ||
}); | ||
_Dataspace.spawn('driver/avahi-browse', function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn10 = _Syndicate.Observe(Observe(Discovered(Service(_Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance)), _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
{ | ||
var _facets6 = _Syndicate.Map(); | ||
var _handler10 = { | ||
skeleton: [Observe.constructorInfo, [Discovered.constructorInfo, [Service.constructorInfo, null, null], null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0, 1])]), | ||
assertion: _assn10, | ||
callback: _Dataspace.wrap(function (_evt10, _vs10) { | ||
if (_evt10 === _Skeleton.EVENT_ADDED) { | ||
var _serviceType2 = _vs10.get(0); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn10 = _Syndicate.Observe(Observe(Discovered(Service(_Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance)), _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c32 = _serviceType2; | ||
var _handler10 = { | ||
skeleton: [Observe.constructorInfo, [Discovered.constructorInfo, [Service.constructorInfo, null, null], null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0, 1])]), | ||
assertion: _assn10, | ||
callback: _Dataspace.wrap(function (_evt10, _vs10) { | ||
if (_evt10 === _Skeleton.EVENT_ADDED) { | ||
var _serviceType3 = _vs10.get(0); | ||
var _assn11 = _Syndicate.Observe(Observe(Discovered(Service(_Syndicate.Discard._instance, _c32), _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets6 = _facets6.set(_Syndicate.fromJS([_serviceType3]), _Dataspace._currentFacet); | ||
var _handler11 = { | ||
skeleton: [Observe.constructorInfo, [Discovered.constructorInfo, [Service.constructorInfo, null, null], null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0, 1])]), | ||
constVals: _Syndicate.fromJS([_c32]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn11, | ||
callback: _Dataspace.wrap(function (_evt11, _vs11) { | ||
if (_evt11 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn11, _handler11]; | ||
}, false); | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
{ | ||
var topFacet = currentFacet(); | ||
var args = ['-f', '-r', '-k', '-p']; | ||
{ | ||
var topFacet = currentFacet(); | ||
var args = ['-f', '-r', '-k', '-p']; | ||
if (typeof _serviceType2 === 'string') { | ||
args.push(_serviceType2); | ||
} else { | ||
args.push('-a'); | ||
} | ||
if (typeof _serviceType3 === 'string') { | ||
args.push(_serviceType3); | ||
} else { | ||
args.push('-a'); | ||
} | ||
if (typeof _serviceType2 !== 'string') { | ||
if (typeof _serviceType3 !== 'string') { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [WildcardBrowserActive(), null]; | ||
}, true); | ||
} else { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c27 = WildcardBrowserActive(); | ||
var _assn11 = _Syndicate.Observe(_c27); | ||
var _handler11 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c27]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn11, | ||
callback: _Dataspace.wrap(function (_evt11, _vs11) { | ||
if (_evt11 === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn11, _handler11]; | ||
}, true); | ||
} | ||
var id = genUuid('avahi-browse'); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [WildcardBrowserActive(), null]; | ||
return [S.Subprocess(id, 'avahi-browse', args, { | ||
stdio: ['ignore', 'pipe', 'ignore'] | ||
}), null]; | ||
}, true); | ||
} else { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c33 = WildcardBrowserActive(); | ||
var _c28 = id; | ||
var _assn12 = _Syndicate.Observe(_c33); | ||
var _assn12 = _Syndicate.Observe(S.SubprocessError(_c28, _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _handler12 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c33]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
skeleton: [S.SubprocessError.constructorInfo, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c28]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn12, | ||
callback: _Dataspace.wrap(function (_evt12, _vs12) { | ||
if (_evt12 === _Skeleton.EVENT_ADDED) { | ||
if (_evt12 === _Skeleton.EVENT_MESSAGE) { | ||
var _err2 = _vs12.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
{ | ||
console.error("Couldn't start avahi-browse", _err2); | ||
} | ||
}); | ||
@@ -435,283 +500,275 @@ }); | ||
}, true); | ||
} | ||
var id = genUuid('avahi-browse'); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c29 = id; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [S.Subprocess(id, 'avahi-browse', args, { | ||
stdio: ['ignore', 'pipe', 'ignore'] | ||
}), null]; | ||
}, true); | ||
var _assn13 = _Syndicate.Observe(S.SubprocessExit(_c29, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance)); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c34 = id; | ||
var _handler13 = { | ||
skeleton: [S.SubprocessExit.constructorInfo, null, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c29]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn13, | ||
callback: _Dataspace.wrap(function (_evt13, _vs13) { | ||
if (_evt13 === _Skeleton.EVENT_ADDED) { | ||
var _code2 = _vs13.get(0); | ||
var _assn13 = _Syndicate.Observe(S.SubprocessError(_c34, _Syndicate.Capture(_Syndicate.Discard._instance))); | ||
var _handler13 = { | ||
skeleton: [S.SubprocessError.constructorInfo, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c34]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn13, | ||
callback: _Dataspace.wrap(function (_evt13, _vs13) { | ||
if (_evt13 === _Skeleton.EVENT_MESSAGE) { | ||
var _err2 = _vs13.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
{ | ||
console.error("Couldn't start avahi-browse", _err2); | ||
} | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
{ | ||
if (_code2 !== 0) { | ||
console.error("Subprocess avahi-browse terminated with code", _code2); | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn13, _handler13]; | ||
}, true); | ||
} | ||
}) | ||
}; | ||
return [_assn13, _handler13]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c35 = id; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c30 = id; | ||
var _assn14 = _Syndicate.Observe(S.SubprocessExit(_c35, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance)); | ||
var _assn14 = _Syndicate.Observe(S.SubprocessRunning(_c30, _Syndicate.Discard._instance, [_Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance])); | ||
var _handler14 = { | ||
skeleton: [S.SubprocessExit.constructorInfo, null, null, null], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c35]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1])]), | ||
assertion: _assn14, | ||
callback: _Dataspace.wrap(function (_evt14, _vs14) { | ||
if (_evt14 === _Skeleton.EVENT_ADDED) { | ||
var _code2 = _vs14.get(0); | ||
var _handler14 = { | ||
skeleton: [S.SubprocessRunning.constructorInfo, null, null, [3, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c30]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([2, 1])]), | ||
assertion: _assn14, | ||
callback: _Dataspace.wrap(function (_evt14, _vs14) { | ||
if (_evt14 === _Skeleton.EVENT_ADDED) { | ||
var _stdout = _vs14.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
if (_code2 !== 0) { | ||
console.error("Subprocess avahi-browse terminated with code", _code2); | ||
} | ||
} | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn14, _handler14]; | ||
}, true); | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c31 = S.Stream(_stdout, S.Readable()); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c36 = id; | ||
var _assn15 = _Syndicate.Observe(_c31); | ||
var _assn15 = _Syndicate.Observe(S.SubprocessRunning(_c36, _Syndicate.Discard._instance, [_Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Discard._instance])); | ||
var _handler15 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c31]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn15, | ||
callback: _Dataspace.wrap(function (_evt15, _vs15) { | ||
if (_evt15 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
topFacet.stop(); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn15, _handler15]; | ||
}, true); | ||
var _handler15 = { | ||
skeleton: [S.SubprocessRunning.constructorInfo, null, null, [3, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c36]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([2, 1])]), | ||
assertion: _assn15, | ||
callback: _Dataspace.wrap(function (_evt15, _vs15) { | ||
if (_evt15 === _Skeleton.EVENT_ADDED) { | ||
var _stdout = _vs15.get(0); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c32 = _stdout; | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c37 = S.Stream(_stdout, S.Readable()); | ||
var _assn16 = _Syndicate.Observe(S.Stream(_c32, S.Line(_Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
var _assn16 = _Syndicate.Observe(_c37); | ||
var _handler16 = { | ||
skeleton: [S.Stream.constructorInfo, null, [S.Line.constructorInfo, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c32]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 0])]), | ||
assertion: _assn16, | ||
callback: _Dataspace.wrap(function (_evt16, _vs16) { | ||
if (_evt16 === _Skeleton.EVENT_MESSAGE) { | ||
var _line2 = _vs16.get(0); | ||
var _handler16 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c37]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn16, | ||
callback: _Dataspace.wrap(function (_evt16, _vs16) { | ||
if (_evt16 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
topFacet.stop(); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn16, _handler16]; | ||
}, true); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
// Parsing of TXT record data (appearing after the port | ||
// number in an '=' record) is unreliable given the way | ||
// avahi-browse formats it. | ||
// | ||
// See https://github.com/lathiat/avahi/pull/206. | ||
// | ||
// However, it's still useful to have, so we do our best! | ||
// | ||
var pieces = _line2.fromUtf8().split(/;/); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c38 = _stdout; | ||
if (pieces[0] === '=') { | ||
// A resolved address record, which has TXT data. | ||
var normalFields = pieces.slice(0, 9); | ||
var txtFields = pieces.slice(9).join(';'); // it's these that are dodgy | ||
var _assn17 = _Syndicate.Observe(S.Stream(_c38, S.Line(_Syndicate.Capture(_Syndicate.Discard._instance)))); | ||
if (txtFields === '') { | ||
normalFields.push([]); | ||
} else { | ||
normalFields.push(txtFields.slice(1, -1).split(/" "/)); // OMG this is vile | ||
} | ||
var _handler17 = { | ||
skeleton: [S.Stream.constructorInfo, null, [S.Line.constructorInfo, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0])]), | ||
constVals: _Syndicate.fromJS([_c38]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 0])]), | ||
assertion: _assn17, | ||
callback: _Dataspace.wrap(function (_evt17, _vs17) { | ||
if (_evt17 === _Skeleton.EVENT_MESSAGE) { | ||
var _line2 = _vs17.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
// Parsing of TXT record data (appearing after the port | ||
// number in an '=' record) is unreliable given the way | ||
// avahi-browse formats it. | ||
// | ||
// See https://github.com/lathiat/avahi/pull/206. | ||
// | ||
// However, it's still useful to have, so we do our best! | ||
// | ||
var pieces = _line2.fromUtf8().split(/;/); | ||
if (pieces[0] === '=') { | ||
// A resolved address record, which has TXT data. | ||
var normalFields = pieces.slice(0, 9); | ||
var txtFields = pieces.slice(9).join(';'); // it's these that are dodgy | ||
if (txtFields === '') { | ||
normalFields.push([]); | ||
_Dataspace.send(BrowserInput(id, normalFields)); | ||
} else { | ||
normalFields.push(txtFields.slice(1, -1).split(/" "/)); // OMG this is vile | ||
// Something else. | ||
_Dataspace.send(BrowserInput(id, pieces)); | ||
} | ||
_Dataspace.send(BrowserInput(id, normalFields)); | ||
} else { | ||
// Something else. | ||
_Dataspace.send(BrowserInput(id, pieces)); | ||
} | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn17, _handler17]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn16, _handler16]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c39 = id; | ||
var _c40 = "+"; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c33 = id; | ||
var _c34 = "+"; | ||
var _assn18 = _Syndicate.Observe(BrowserInput(_c39, [_c40, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
var _assn17 = _Syndicate.Observe(BrowserInput(_c33, [_c34, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
var _handler18 = { | ||
skeleton: [BrowserInput.constructorInfo, null, [6, null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([1, 0])]), | ||
constVals: _Syndicate.fromJS([_c39, _c40]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 1]), _Syndicate.fromJS([1, 2]), _Syndicate.fromJS([1, 3]), _Syndicate.fromJS([1, 4]), _Syndicate.fromJS([1, 5])]), | ||
assertion: _assn18, | ||
callback: _Dataspace.wrap(function (_evt18, _vs18) { | ||
if (_evt18 === _Skeleton.EVENT_MESSAGE) { | ||
var _interfaceName = _vs18.get(0); | ||
var _handler17 = { | ||
skeleton: [BrowserInput.constructorInfo, null, [6, null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([1, 0])]), | ||
constVals: _Syndicate.fromJS([_c33, _c34]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 1]), _Syndicate.fromJS([1, 2]), _Syndicate.fromJS([1, 3]), _Syndicate.fromJS([1, 4]), _Syndicate.fromJS([1, 5])]), | ||
assertion: _assn17, | ||
callback: _Dataspace.wrap(function (_evt17, _vs17) { | ||
if (_evt17 === _Skeleton.EVENT_MESSAGE) { | ||
var _interfaceName = _vs17.get(0); | ||
var _family = _vs18.get(1); | ||
var _family = _vs17.get(1); | ||
var _name2 = _vs18.get(2); | ||
var _name3 = _vs17.get(2); | ||
var _serviceType3 = _vs18.get(3); | ||
var _serviceType4 = _vs17.get(3); | ||
var _domain = _vs18.get(4); | ||
var _domain = _vs17.get(4); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
var svc = Service(unescapeLabel(_name2), unescapeLabel(_serviceType3)); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
var svc = Service(unescapeLabel(_name3), unescapeLabel(_serviceType4)); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c41 = BrowserInput(id, ["-", _interfaceName, _family, _name2, _serviceType3, _domain]); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c35 = BrowserInput(id, ["-", _interfaceName, _family, _name3, _serviceType4, _domain]); | ||
var _assn19 = _Syndicate.Observe(_c41); | ||
var _assn18 = _Syndicate.Observe(_c35); | ||
var _handler19 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c41]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn19, | ||
callback: _Dataspace.wrap(function (_evt19, _vs19) { | ||
if (_evt19 === _Skeleton.EVENT_MESSAGE) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
var _handler18 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c35]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn18, | ||
callback: _Dataspace.wrap(function (_evt18, _vs18) { | ||
if (_evt18 === _Skeleton.EVENT_MESSAGE) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn19, _handler19]; | ||
}, true); | ||
} | ||
}) | ||
}; | ||
return [_assn18, _handler18]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c42 = id; | ||
var _c43 = '='; | ||
var _c44 = _interfaceName; | ||
var _c45 = _family; | ||
var _c46 = _name2; | ||
var _c47 = _serviceType3; | ||
var _c48 = _domain; | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c36 = id; | ||
var _c37 = '='; | ||
var _c38 = _interfaceName; | ||
var _c39 = _family; | ||
var _c40 = _name3; | ||
var _c41 = _serviceType4; | ||
var _c42 = _domain; | ||
var _assn20 = _Syndicate.Observe(BrowserInput(_c42, [_c43, _c44, _c45, _c46, _c47, _c48, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
var _assn19 = _Syndicate.Observe(BrowserInput(_c36, [_c37, _c38, _c39, _c40, _c41, _c42, _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance), _Syndicate.Capture(_Syndicate.Discard._instance)])); | ||
var _handler20 = { | ||
skeleton: [BrowserInput.constructorInfo, null, [10, null, null, null, null, null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([1, 0]), _Syndicate.fromJS([1, 1]), _Syndicate.fromJS([1, 2]), _Syndicate.fromJS([1, 3]), _Syndicate.fromJS([1, 4]), _Syndicate.fromJS([1, 5])]), | ||
constVals: _Syndicate.fromJS([_c42, _c43, _c44, _c45, _c46, _c47, _c48]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 6]), _Syndicate.fromJS([1, 7]), _Syndicate.fromJS([1, 8]), _Syndicate.fromJS([1, 9])]), | ||
assertion: _assn20, | ||
callback: _Dataspace.wrap(function (_evt20, _vs20) { | ||
if (_evt20 === _Skeleton.EVENT_MESSAGE) { | ||
var _hostName3 = _vs20.get(0); | ||
var _handler19 = { | ||
skeleton: [BrowserInput.constructorInfo, null, [10, null, null, null, null, null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([0]), _Syndicate.fromJS([1, 0]), _Syndicate.fromJS([1, 1]), _Syndicate.fromJS([1, 2]), _Syndicate.fromJS([1, 3]), _Syndicate.fromJS([1, 4]), _Syndicate.fromJS([1, 5])]), | ||
constVals: _Syndicate.fromJS([_c36, _c37, _c38, _c39, _c40, _c41, _c42]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([1, 6]), _Syndicate.fromJS([1, 7]), _Syndicate.fromJS([1, 8]), _Syndicate.fromJS([1, 9])]), | ||
assertion: _assn19, | ||
callback: _Dataspace.wrap(function (_evt19, _vs19) { | ||
if (_evt19 === _Skeleton.EVENT_MESSAGE) { | ||
var _hostName5 = _vs19.get(0); | ||
var _address = _vs20.get(1); | ||
var _address = _vs19.get(1); | ||
var _portStr = _vs20.get(2); | ||
var _portStr = _vs19.get(2); | ||
var _txtDataRecords3 = _vs20.get(3); | ||
var _txtDataRecords5 = _vs19.get(3); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var port0 = Number(_portStr); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var port0 = Number(_portStr); | ||
var _port3 = Number.isNaN(port0) ? null : port0; | ||
var _port5 = Number.isNaN(port0) ? null : port0; | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [Discovered(svc, _hostName3, _port3, _txtDataRecords3, _address, _family, _interfaceName), null]; | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [Discovered(svc, _hostName5, _port5, _txtDataRecords5, _address, _family, _interfaceName), null]; | ||
}, true); | ||
}, true); | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn20, _handler20]; | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn19, _handler19]; | ||
}, true); | ||
}, true); | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn18, _handler18]; | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn17, _handler17]; | ||
}, true); | ||
}, true); | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn15, _handler15]; | ||
}, true); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn14, _handler14]; | ||
}, true); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn10, _handler10]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn20 = _Syndicate.Observe(Observe(Discovered(Service(_Syndicate.Discard._instance, _Syndicate.Capture(_Syndicate.Discard._instance)), _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _handler20 = { | ||
skeleton: [Observe.constructorInfo, [Discovered.constructorInfo, [Service.constructorInfo, null, null], null, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([_Syndicate.fromJS([0, 0, 1])]), | ||
assertion: _assn20, | ||
callback: _Dataspace.wrap(function (_evt20, _vs20) { | ||
if (_evt20 === _Skeleton.EVENT_REMOVED) { | ||
var _serviceType5 = _vs20.get(0); | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var _key6 = _Syndicate.fromJS([_serviceType5]); | ||
_facets6.get(_key6).stop(); | ||
_facets6 = _facets6.remove(_key6); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn10, _handler10]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn20, _handler20]; | ||
}, true); | ||
} | ||
}); | ||
@@ -718,0 +775,0 @@ |
@@ -86,205 +86,245 @@ "use strict"; | ||
_Dataspace.spawn('IPRouteDatabase', function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn = _Syndicate.Observe(Observe(Route(_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
{ | ||
var _facets2 = _Syndicate.Map(); | ||
var _handler = { | ||
skeleton: [Observe.constructorInfo, [Route.constructorInfo, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn, | ||
callback: _Dataspace.wrap(function (_evt, _vs) { | ||
if (_evt === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn2 = _Syndicate.Observe(Observe(Route(_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn = _Syndicate.Observe(Observe(Route(_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _handler2 = { | ||
skeleton: [Observe.constructorInfo, [Route.constructorInfo, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn2, | ||
callback: _Dataspace.wrap(function (_evt2, _vs2) { | ||
if (_evt2 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn2, _handler2]; | ||
}, false); | ||
var _handler = { | ||
skeleton: [Observe.constructorInfo, [Route.constructorInfo, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn, | ||
callback: _Dataspace.wrap(function (_evt, _vs) { | ||
if (_evt === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets2 = _facets2.set(_Syndicate.fromJS([]), _Dataspace._currentFacet); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [ScanRoutingTable(), null]; | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [ScanRoutingTable(), null]; | ||
}, true); | ||
}, true); | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn, _handler]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn, _handler]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn3 = _Syndicate.Observe(Observe(DefaultGateway(_Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn2 = _Syndicate.Observe(Observe(Route(_Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _handler3 = { | ||
skeleton: [Observe.constructorInfo, [DefaultGateway.constructorInfo, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn3, | ||
callback: _Dataspace.wrap(function (_evt3, _vs3) { | ||
if (_evt3 === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn4 = _Syndicate.Observe(Observe(DefaultGateway(_Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _handler2 = { | ||
skeleton: [Observe.constructorInfo, [Route.constructorInfo, null, null, null, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn2, | ||
callback: _Dataspace.wrap(function (_evt2, _vs2) { | ||
if (_evt2 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var _key2 = _Syndicate.fromJS([]); | ||
var _handler4 = { | ||
skeleton: [Observe.constructorInfo, [DefaultGateway.constructorInfo, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn4, | ||
callback: _Dataspace.wrap(function (_evt4, _vs4) { | ||
if (_evt4 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn4, _handler4]; | ||
}, false); | ||
_facets2.get(_key2).stop(); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [ScanRoutingTable(), null]; | ||
_facets2 = _facets2.remove(_key2); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn2, _handler2]; | ||
}, true); | ||
} | ||
{ | ||
var _facets4 = _Syndicate.Map(); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn3 = _Syndicate.Observe(Observe(DefaultGateway(_Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _handler3 = { | ||
skeleton: [Observe.constructorInfo, [DefaultGateway.constructorInfo, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn3, | ||
callback: _Dataspace.wrap(function (_evt3, _vs3) { | ||
if (_evt3 === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets4 = _facets4.set(_Syndicate.fromJS([]), _Dataspace._currentFacet); | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [ScanRoutingTable(), null]; | ||
}, true); | ||
}, true); | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn3, _handler3]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn3, _handler3]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c5 = ScanRoutingTable(); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _assn4 = _Syndicate.Observe(Observe(DefaultGateway(_Syndicate.Discard._instance, _Syndicate.Discard._instance))); | ||
var _assn5 = _Syndicate.Observe(_c5); | ||
var _handler4 = { | ||
skeleton: [Observe.constructorInfo, [DefaultGateway.constructorInfo, null, null]], | ||
constPaths: _Syndicate.fromJS([]), | ||
constVals: _Syndicate.fromJS([]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn4, | ||
callback: _Dataspace.wrap(function (_evt4, _vs4) { | ||
if (_evt4 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var _key4 = _Syndicate.fromJS([]); | ||
var _handler5 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c5]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn5, | ||
callback: _Dataspace.wrap(function (_evt5, _vs5) { | ||
if (_evt5 === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c6 = ScanRoutingTable(); | ||
_facets4.get(_key4).stop(); | ||
var _assn6 = _Syndicate.Observe(_c6); | ||
_facets4 = _facets4.remove(_key4); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn4, _handler4]; | ||
}, true); | ||
} | ||
{ | ||
var _facets6 = _Syndicate.Map(); | ||
var _handler6 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c6]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn6, | ||
callback: _Dataspace.wrap(function (_evt6, _vs6) { | ||
if (_evt6 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
; | ||
}); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c6 = ScanRoutingTable(); | ||
var _assn5 = _Syndicate.Observe(_c6); | ||
var _handler5 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c6]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn5, | ||
callback: _Dataspace.wrap(function (_evt5, _vs5) { | ||
if (_evt5 === _Skeleton.EVENT_ADDED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_facets6 = _facets6.set(_Syndicate.fromJS([]), _Dataspace._currentFacet); | ||
_Dataspace._currentFacet.addDataflow(function () { | ||
void 0; | ||
}); | ||
{ | ||
var refresh = function refresh() { | ||
var rows = fs.readFileSync('/proc/net/route').toString('utf-8').split('\n').filter(function (x) { | ||
return x; | ||
}).map(function (x) { | ||
return x.split('\t').map(function (f) { | ||
return f.trim(); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn6, _handler6]; | ||
}, false); | ||
{ | ||
var refresh = function refresh() { | ||
var rows = fs.readFileSync('/proc/net/route').toString('utf-8').split('\n').filter(function (x) { | ||
return x; | ||
}).map(function (x) { | ||
return x.split('\t').map(function (f) { | ||
return f.trim(); | ||
}); | ||
}); | ||
var headings = rows.shift(); | ||
var data = rows.map(function (row) { | ||
var rec = {}; | ||
headings.forEach(function (heading, i) { | ||
rec[heading] = row[i] || ''; | ||
var headings = rows.shift(); | ||
var data = rows.map(function (row) { | ||
var rec = {}; | ||
headings.forEach(function (heading, i) { | ||
rec[heading] = row[i] || ''; | ||
}); | ||
return rec; | ||
}); | ||
return rec; | ||
}); | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c7 = PeriodicTick(5000); | ||
_Dataspace._currentFacet.actor.addFacet(_Dataspace._currentFacet, function () { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c7 = PeriodicTick(5000); | ||
var _assn7 = _Syndicate.Observe(_c7); | ||
var _assn6 = _Syndicate.Observe(_c7); | ||
var _handler7 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c7]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn7, | ||
callback: _Dataspace.wrap(function (_evt7, _vs7) { | ||
if (_evt7 === _Skeleton.EVENT_MESSAGE) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
refresh(); | ||
var _handler6 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c7]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn6, | ||
callback: _Dataspace.wrap(function (_evt6, _vs6) { | ||
if (_evt6 === _Skeleton.EVENT_MESSAGE) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
_Dataspace._currentFacet.stop(function () { | ||
refresh(); | ||
}); | ||
}); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn7, _handler7]; | ||
}, true); | ||
} | ||
}) | ||
}; | ||
return [_assn6, _handler6]; | ||
}, true); | ||
data.forEach(function (rec) { | ||
var destnet = littleEndianHex(rec.Destination); | ||
var destmask = 32 - countZeroBits(littleEndianHex(rec.Mask)); | ||
var gateway = littleEndianHex(rec.Gateway); | ||
data.forEach(function (rec) { | ||
var destnet = littleEndianHex(rec.Destination); | ||
var destmask = 32 - countZeroBits(littleEndianHex(rec.Mask)); | ||
var gateway = littleEndianHex(rec.Gateway); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [Route(rec.Iface, intToIPv4(destnet), destmask, intToIPv4(gateway), decodeFlags(Number.parseInt(rec.Flags, 16))), null]; | ||
}, true); | ||
if (destnet === 0 && destmask === 0) { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [DefaultGateway(rec.Iface, intToIPv4(gateway)), null]; | ||
return [Route(rec.Iface, intToIPv4(destnet), destmask, intToIPv4(gateway), decodeFlags(Number.parseInt(rec.Flags, 16))), null]; | ||
}, true); | ||
} | ||
}); | ||
}, true); | ||
}; | ||
_Dataspace._currentFacet.addStartScript(function () { | ||
refresh(); | ||
}); | ||
if (destnet === 0 && destmask === 0) { | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
return [DefaultGateway(rec.Iface, intToIPv4(gateway)), null]; | ||
}, true); | ||
} | ||
}); | ||
}, true); | ||
}; | ||
_Dataspace._currentFacet.addStartScript(function () { | ||
refresh(); | ||
}); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn5, _handler5]; | ||
}, true); | ||
_Dataspace._currentFacet.addEndpoint(function () { | ||
var _c8 = ScanRoutingTable(); | ||
var _assn7 = _Syndicate.Observe(_c8); | ||
var _handler7 = { | ||
skeleton: null, | ||
constPaths: _Syndicate.fromJS([_Syndicate.fromJS([])]), | ||
constVals: _Syndicate.fromJS([_c8]), | ||
capturePaths: _Syndicate.fromJS([]), | ||
assertion: _assn7, | ||
callback: _Dataspace.wrap(function (_evt7, _vs7) { | ||
if (_evt7 === _Skeleton.EVENT_REMOVED) { | ||
_Dataspace._currentFacet.actor.scheduleScript(function () { | ||
{ | ||
var _key6 = _Syndicate.fromJS([]); | ||
_facets6.get(_key6).stop(); | ||
_facets6 = _facets6.remove(_key6); | ||
} | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn5, _handler5]; | ||
}, true); | ||
}); | ||
} | ||
}) | ||
}; | ||
return [_assn7, _handler7]; | ||
}, true); | ||
} | ||
}); | ||
@@ -291,0 +331,0 @@ |
{ | ||
"name": "@syndicate-lang/driver-mdns", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "mDNS support for Syndicate/js via Avahi", | ||
@@ -19,10 +19,10 @@ "main": "lib/index.js", | ||
"@babel/preset-env": "^7.2.0", | ||
"@syndicate-lang/syntax": "^0.1.0" | ||
"@syndicate-lang/syntax": "^0.1.1" | ||
}, | ||
"dependencies": { | ||
"@syndicate-lang/core": "^0.2.7", | ||
"@syndicate-lang/driver-streams-node": "^0.2.7", | ||
"@syndicate-lang/driver-timer": "^0.2.7" | ||
"@syndicate-lang/driver-streams-node": "^0.2.8", | ||
"@syndicate-lang/driver-timer": "^0.2.8" | ||
}, | ||
"gitHead": "413f28bf2055fc5453dac609fe5dd19fe9ad618a" | ||
"gitHead": "a4d875e03c1f997da01a33ffd34ff672ad0fbdaa" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99446
1220