_stream_chunk(chunk, total_size) {
        // If the request has already been completed, we can resolve the promise immediately as we cannot write to the client anymore
        if (this.completed) return Promise.resolve();

        // Return a Promise which resolves once the chunk has been fully sent to the client
        return new Promise((resolve) =>
            this.atomic(() => {
                // Ensure the client is still connected after the cork
                if (this.completed) return resolve();

                // Initiate the response to ensure status code & headers get written first if they have not been written yet
                this._initiate_response();

                // Remember the initial write offset for future backpressure sliced chunks
                // Write the chunk to the client using the appropriate uWS chunk writing method
                const write_offset = this.write_offset;
                const [sent] = this._uws_write_chunk(chunk, total_size);
                if (sent) {
                    // The chunk was fully sent, we can resolve the promise
                    resolve();
                } else {
                    // Bind a drain handler to relieve backpressure
                    // Note! This callback may be called as many times as neccessary to send a full chunk when using the tryEnd method
                    this.drain((offset) => {
                        // Check if the response has been completed / connection has been closed since we can no longer write to the client
                        // When total_size is not provided, the chunk has been fully sent already via uWS.write()
                        // Only when total_size is provided we need to retry to send the ramining chunk since we have used uWS.tryEnd() and
                        // that does not guarantee that the whole chunk has been sent when stream is drained
                        if (this.completed || !total_size) {
                            resolve();
                            return true;
                        }

                        // Attempt to write the remaining chunk to the client
                        const remaining = chunk.slice(offset - write_offset);
                        const [flushed] = this._uws_write_chunk(remaining, total_size);
                        if (flushed) resolve();

                        // Return the flushed boolean as not flushed means we are still waiting for more drain events from uWS
                        return flushed;
                    });
                }
            })
        );
    }
Stream an individual chunk to the client with backpressure handling.
Delivers with chunked transfer and without content-length header when no total_size is specified.
Delivers with chunk writes and content-length header when a total_size is specified.
Calls the `callback` once the chunk has been fully sent to the client.

@private
@param {Buffer} chunk
@param {Number=} total_size
@returns {Promise}