@@ -48,7 +48,9 @@ var Client = require('./client');
48
48
var util = require ( 'util' ) ;
49
49
var Kafka = require ( '../librdkafka' ) ;
50
50
var LibrdKafkaError = require ( './error' ) ;
51
- var shallowCopy = require ( './util' ) . shallowCopy ;
51
+ var { shallowCopy, bindingVersion } = require ( './util' ) ;
52
+
53
+ util . inherits ( AdminClient , Client ) ;
52
54
53
55
/**
54
56
* Create a new AdminClient for making topics, partitions, and more.
@@ -108,7 +110,7 @@ function AdminClient(conf) {
108
110
* for the topic.
109
111
*/
110
112
111
- this . _client = new Kafka . AdminClient ( conf ) ;
113
+ Client . call ( this , conf , Kafka . AdminClient ) ;
112
114
this . _isConnected = false ;
113
115
this . globalConfig = conf ;
114
116
}
@@ -122,6 +124,7 @@ function AdminClient(conf) {
122
124
* Unlike the other connect methods, this one is synchronous.
123
125
*/
124
126
AdminClient . prototype . connect = function ( ) {
127
+ this . _client . configureCallbacks ( true , this . _cb_configs ) ;
125
128
LibrdKafkaError . wrap ( this . _client . connect ( ) , true ) ;
126
129
this . _isConnected = true ;
127
130
} ;
@@ -135,6 +138,9 @@ AdminClient.prototype.connect = function () {
135
138
AdminClient . prototype . disconnect = function ( ) {
136
139
LibrdKafkaError . wrap ( this . _client . disconnect ( ) , true ) ;
137
140
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 ) ;
138
144
} ;
139
145
140
146
/**
0 commit comments