ResourceLoan.js 582 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. const Deferred = require("./Deferred");
  3. /**
  4. * Plan is to maybe add tracking via Error objects
  5. * and other fun stuff!
  6. */
  7. class ResourceLoan extends Deferred {
  8. /**
  9. *
  10. * @param {any} pooledResource the PooledResource this loan belongs to
  11. * @return {any} [description]
  12. */
  13. constructor(pooledResource, Promise) {
  14. super(Promise);
  15. this._creationTimestamp = Date.now();
  16. this.pooledResource = pooledResource;
  17. }
  18. reject() {
  19. /**
  20. * Loans can only be resolved at the moment
  21. */
  22. }
  23. }
  24. module.exports = ResourceLoan;