resolveFunc(key) {
    let result = this.get(key);
    if (result !== undefined) {
      return Promise.resolve(result);
    }
    result = funcMap[key];
    if (result === undefined) {
      return Promise.reject(new Error(`Cache entry ${key} not found`));
    }
    try {
      result = result.func();
    } catch (err) {
      return Promise.reject(err);
    }
    return Promise.resolve(result) // func is found, resolve, set with TTL and return result
      .then((r) => {
        this.set(key, r, funcMap[key].ttl);
        return r;
      });
  }
Get cached result associated with the key or execute a function to get the result.

@param {string} [key]  - A key associated with a function to be executed.
@returns {Promise} - Promise either resolved with cached result of the function or rejected
                   with function not found.