1
This commit is contained in:
parent
50330479b7
commit
0369807a68
@ -1,4 +1,26 @@
|
|||||||
function getEventHandle() {
|
const events = {};
|
||||||
|
|
||||||
|
async function internalAdd(clsName, modName) {
|
||||||
|
const modClass = require('./' + modName);
|
||||||
|
events[clsName] = {
|
||||||
|
'clsName': clsName,
|
||||||
|
'modName': modName,
|
||||||
|
'class': modClass,
|
||||||
|
};
|
||||||
|
if (modClass.staticInit) {
|
||||||
|
await modClass.staticInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function add(clsName, modName) {
|
||||||
|
await internalAdd(clsName, modName);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEventHandle(eventProc) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6,5 +28,6 @@ function createEventHandle(eventProc, eventHandle) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.init = init;
|
||||||
exports.getEventHandle = getEventHandle;
|
exports.getEventHandle = getEventHandle;
|
||||||
exports.createEventHandle = createEventHandle;
|
exports.createEventHandle = createEventHandle;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
const eventsFactory = require('./events/factory');
|
||||||
const services = {};
|
const services = {};
|
||||||
|
|
||||||
async function internalAdd(clsName, modName, isSingle) {
|
async function internalAdd(clsName, modName, isSingle) {
|
||||||
@ -24,6 +25,7 @@ async function addSingle(clsName, modName) {
|
|||||||
async function init() {
|
async function init() {
|
||||||
await add(['PullDbEvent'], 'pull_dbevent');
|
await add(['PullDbEvent'], 'pull_dbevent');
|
||||||
await add(['DbEventProcess'], 'dbevent_process');
|
await add(['DbEventProcess'], 'dbevent_process');
|
||||||
|
await eventsFactory.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
function create(name, session = null) {
|
function create(name, session = null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user