feat: Introduce API.Task API that allow to track promise object via AntOS announcement system

This commit is contained in:
DanyLE
2023-06-16 17:54:12 +02:00
committed by Dany LE
parent 0ac886f644
commit 4d59b104b9
5 changed files with 74 additions and 223 deletions

View File

@ -290,12 +290,6 @@ namespace OS {
* and callbacks
*/
export var observable: API.Announcer = new API.Announcer();
/**
* This variable is used to allocate the `id` of all messages
* passing between publishers and subscribers in the
* system announcement
*/
export var quota: 0;
/**
* Placeholder of all global events listeners
*/
@ -412,16 +406,5 @@ namespace OS {
}
announcer.listeners.delete(app);
}
/**
* Allocate message id
*
* @export
* @returns {number}
*/
export function getMID(): number {
quota += 1;
return quota;
}
}
}