This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/mysql2/lib/commands/register_slave.js

26 lines
709 B
JavaScript

var Command = require('./command');
var util = require('util');
var CommandCode = require('../constants/commands');
var Packets = require('../packets');
function RegisterSlave(opts, callback)
{
Command.call(this);
this.onResult = callback;
this.opts = opts;
}
util.inherits(RegisterSlave, Command);
RegisterSlave.prototype.start = function(packet, connection) {
var packet = new Packets.RegisterSlave(this.opts);
connection.writePacket(packet.toPacket(1));
return RegisterSlave.prototype.registerResponse;
};
RegisterSlave.prototype.registerResponse = function(packet) {
if (this.onResult)
process.nextTick(this.onResult.bind(this));
return null;
};
module.exports = RegisterSlave;