MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / constructor

Method constructor

lib/writers.js:184–201  ·  view source on GitHub ↗

* Creates a new WriteQueue instance. * @param {Socket} netClient * @param {Encoder} encoder * @param {ClientOptions} options

(netClient, encoder, options)

Source from the content-addressed store, hash-verified

182 * @param {ClientOptions} options
183 */
184 constructor(netClient, encoder, options) {
185 super();
186 this.netClient = netClient;
187 this.encoder = encoder;
188 this.isRunning = false;
189 /** @type {Array<{operation: OperationState, callback: Function}>} */
190 this.queue = [];
191 this.coalescingThreshold = options.socketOptions.coalescingThreshold;
192 this.error = null;
193 this.canWrite = true;
194
195 // Listen to drain event that is going to be fired once
196 // the underlying buffer is empty
197 netClient.on('drain', () => {
198 this.canWrite = true;
199 this.run();
200 });
201 }
202
203 /**
204 * Enqueues a new request

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected