function ready(context, callback, req) {
  if (context.state) {
    callback(context.stats);

    return;
  }

  const name = (req && req.url) || callback.name;

  context.logger.info(`wait until bundle finished${name ? `: ${name}` : ""}`);
  context.callbacks.push(callback);
}
@template {IncomingMessage} Request
@template {ServerResponse} Response
@param {import("../index.js").FilledContext<Request, Response>} context context
@param {Callback} callback callback
@param {Request=} req req
@returns {void}