ConnectionDelegate.js 717 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. 'use strict';
  2. /**
  3. * @callback responseHandler
  4. * @param {*} value
  5. */
  6. /**
  7. * @callback errorHandler
  8. * @param {Error} error
  9. */
  10. /**
  11. * Handle the requests of a connection.
  12. */
  13. class ConnectionDelegate
  14. {
  15. /**
  16. * Constructor.
  17. *
  18. * @param {Object} options
  19. */
  20. constructor(options)
  21. {
  22. this.options = options;
  23. }
  24. /**
  25. * Handle the provided instruction and respond to it.
  26. *
  27. * @param {Instruction} instruction
  28. * @param {responseHandler} responseHandler
  29. * @param {errorHandler} errorHandler
  30. */
  31. handleInstruction(instruction, responseHandler, errorHandler)
  32. {
  33. responseHandler(null);
  34. }
  35. }
  36. module.exports = ConnectionDelegate;