code: function update(start, success, result) {
          const c = ctx.ctx;
          if (start) {
              npm.utils.addReadProp(c, 'start', new Date());
          } else {
              c.finish = new Date();
              c.success = success;
              c.result = result;
              c.duration = c.finish - c.start;
              npm.utils.lock(c, true);
          }
          (isTX ? npm.events.transact : npm.events.task)(ctx.options, {
              client: ctx.db && ctx.db.client, // loss of connectivity is possible at this point
              dc: ctx.dc,
              ctx: c
          });
      }
docs: updates the task context and notifies the client;