net-helper/components/_component.js
2025-01-23 16:22:26 +03:00

22 lines
489 B
JavaScript

module.exports = class Component {
constructor (address, syntaxTree) {
this.adr = address;
this.syntax = syntaxTree;
}
// Run server
run () {}
// Stop server
stop () {}
// Working with domains
domainAction (context, domain) {}
// Call this function where need works with domain (DO NOT REWRITE)
callDomain (domain, domainST) {
const component = new domainST.Type(this.adr, domainST);
return { argv: (...argv) => component.domainAction(this, domain, ...argv) };
}
};