@@ -48,7 +48,9 @@ var Client = require('./client');
4848var util = require ( 'util' ) ;
4949var Kafka = require ( '../librdkafka' ) ;
5050var LibrdKafkaError = require ( './error' ) ;
51- var shallowCopy = require ( './util' ) . shallowCopy ;
51+ var { shallowCopy, bindingVersion } = require ( './util' ) ;
52+
53+ util . inherits ( AdminClient , Client ) ;
5254
5355/**
5456 * Create a new AdminClient for making topics, partitions, and more.
@@ -108,7 +110,7 @@ function AdminClient(conf) {
108110 * for the topic.
109111 */
110112
111- this . _client = new Kafka . AdminClient ( conf ) ;
113+ Client . call ( this , conf , Kafka . AdminClient ) ;
112114 this . _isConnected = false ;
113115 this . globalConfig = conf ;
114116}
@@ -122,6 +124,7 @@ function AdminClient(conf) {
122124 * Unlike the other connect methods, this one is synchronous.
123125 */
124126AdminClient . prototype . connect = function ( ) {
127+ this . _client . configureCallbacks ( true , this . _cb_configs ) ;
125128 LibrdKafkaError . wrap ( this . _client . connect ( ) , true ) ;
126129 this . _isConnected = true ;
127130} ;
@@ -135,6 +138,9 @@ AdminClient.prototype.connect = function () {
135138AdminClient . prototype . disconnect = function ( ) {
136139 LibrdKafkaError . wrap ( this . _client . disconnect ( ) , true ) ;
137140 this . _isConnected = false ;
141+ // The AdminClient doesn't provide a callback. So we can't
142+ // wait for completion.
143+ this . _client . configureCallbacks ( false , this . _cb_configs ) ;
138144} ;
139145
140146/**
0 commit comments