docs: async function initModule (ravelInstance) {
    const self = this;
    const name = Metadata.getClassMetaValue(Object.getPrototypeOf(self), '@role', 'name');
    // run @postinject handlers
    const postInjects = Metadata.getClassMeta(Object.getPrototypeOf(self), '@postinject', Object.create(null));
    await Promise.all(Object.keys(postInjects).map(f => postInjects[f].call(self)));
    // connect any Ravel lifecycle handlers to the appropriate events
    function connectHandlers (decorator, event) {
      const handlers = Metadata.getClassMeta(Object.getPrototypeOf(self), decorator, Object.create(null));
      for (const f of Object.keys(handlers)) {
        ravelInstance.once(event, (...args) => {
          ravelInstance.$log.trace(`${name}: Invoking ${decorator} ${f}`);
          handlers[f].apply(self, args);
        });
      }
    }
    connectHandlers('@postinit', 'post init');
    connectHandlers('@prelisten', 'pre listen');
    connectHandlers('@koaconfig', 'pre routes init');
    connectHandlers('@postlisten', 'post listen');
    connectHandlers('@preclose', 'end');
  
    // connect @interval
    const handlers = Metadata.getClassMeta(Object.getPrototypeOf(self), '@interval', Object.create(null));
    const intervals = [];
    ravelInstance.once('post listen', () => {
      for (const f of Object.keys(handlers)) {
        intervals.push(setInterval(() => {
          ravelInstance.$log.trace(`${name}: Invoking @interval ${f}`);
          handlers[f].handler.call(self);
        }, handlers[f].interval));
      }
    });
    ravelInstance.once('end', () => {
      intervals.forEach((i) => clearInterval(i));
    });
  
    // register middleware
    const middleware = Metadata.getClassMeta(Object.getPrototypeOf(self), '@middleware', Object.create(null));
    ravelInstance.once('post module init', () => {
      for (const m of Object.keys(middleware)) {
        if (ravelInstance[symbols.moduleFactories][m]) {
          throw new $err.DuplicateEntry(
            `Unable to register @middleware with name ${m}, which conflicts with an existing Module name`);
        } else {
          ravelInstance.$log.info(`Registering middleware with name ${m}`);
          ravelInstance[symbols.middleware][m] = middleware[m].bind(self);
        }
      }
    });
  }