_locateStrategy.js 476 B

123456789101112131415161718192021222324
  1. var util = require('util');
  2. var events = require('events');
  3. function Command() {
  4. events.EventEmitter.call(this);
  5. }
  6. util.inherits(Command, events.EventEmitter);
  7. Command.prototype.command = function(callback) {
  8. var self = this;
  9. this.client.locateStrategy = this.strategy;
  10. process.nextTick(function() {
  11. if (typeof callback == 'function') {
  12. callback.call(self.client.api);
  13. }
  14. self.emit('complete');
  15. });
  16. return this;
  17. };
  18. module.exports = Command;