app.js 389 B

123456789101112131415161718
  1. 'use strict';
  2. class AppBootHook {
  3. constructor(app) {
  4. this.app = app;
  5. }
  6. async didReady() {
  7. // 应用已经启动完毕
  8. const ctx = await this.app.createAnonymousContext();
  9. await ctx.service.rabbitmq.mission();
  10. }
  11. async serverDidReady() {
  12. // 应用已经启动完毕
  13. const ctx = await this.app.createAnonymousContext();
  14. }
  15. }
  16. module.exports = AppBootHook;