c9 / architect

A simple yet powerful plugin system for large-scale node applications
MIT License
982 stars 129 forks source link

How to access ready signal in plugins ? #44

Closed jeremieca closed 7 years ago

jeremieca commented 9 years ago

Hello,

I have a question about ready signal. Is a way to access ready signal from plugin. When the whole app is ready I want a plugin do some stuff. Is it possible ?

Thanks ! Jérémie.

jeremieca commented 9 years ago

Hey !

I have found the answer. There is a default service called "hub" available for that.

package.json :

 "plugin": {
         "consumes": ["hub", .... ],
         ....

plugin file :

 var hub = imports.hub;
 hub.on('ready', function () {
        console.log('Called when architect is ready ! :)');
 });

Issue is closed :)