First commit
This commit is contained in:
44
framework/client/processManager/processManager.promise.js
Normal file
44
framework/client/processManager/processManager.promise.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2020, 2023, The Unified Company.
|
||||
|
||||
This code is part of Unify.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE,
|
||||
as published by the Free Software Foundation.
|
||||
See the GNU AFFERO GENERAL PUBLIC LICENSE, for more details.
|
||||
|
||||
https://unifyjs.org
|
||||
|
||||
*/
|
||||
|
||||
import tools from '../../unify/tools.js';
|
||||
|
||||
export default class processManagerPromise{
|
||||
|
||||
process( message ) {
|
||||
|
||||
var promise = this.promiseManager.getPromiseByID( message.id );
|
||||
|
||||
this.promiseManager.addMessage( message );
|
||||
|
||||
promise.resolve();
|
||||
|
||||
var object = message.data;
|
||||
|
||||
if( object && typeof object == "object" && !Array.isArray( object ) ) {
|
||||
|
||||
var className = tools.getClassNameByObject( object );
|
||||
|
||||
if( promise.object.debug | document.debugALL ) {
|
||||
|
||||
console.log( "%c recieved message: ", "background: #8bc34a;", this.port, message, className );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user