ServerHttp2Stream

sealed external interface ServerHttp2Stream : Http2Stream(source)

Properties

Link copied to clipboard
open override val _construct: (callback: (JsError?) -> Unit) -> Unit?
Link copied to clipboard
open override val _writev: (chunks: Array<WritableWritevChunksItem>, callback: (JsError?) -> Unit) -> Unit?
Link copied to clipboard
abstract val aborted: Boolean

Set to true if the Http2Stream instance was aborted abnormally. When set, the 'aborted' event will have been emitted.

Link copied to clipboard

If false then the stream will automatically end the writable side when the readable side ends. Set initially by the allowHalfOpen constructor option, which defaults to true.

Link copied to clipboard
abstract val bufferSize: Double

This property shows the number of characters currently buffered to be written. See net.Socket.bufferSize for details.

Link copied to clipboard
abstract override val closed: Boolean

Set to true if the Http2Stream instance has been closed.

Link copied to clipboard
open override var destroyed: Boolean

Is true after readable.destroy() has been called.

Link copied to clipboard
Link copied to clipboard
abstract val endAfterHeaders: Boolean

Set to true if the END_STREAM flag was set in the request or response HEADERS frame received, indicating that no additional data should be received and the readable side of the Http2Stream will be closed.

Link copied to clipboard
open override val errored: JsError?

Returns error if the stream has been destroyed with an error.

Link copied to clipboard
abstract val headersSent: Boolean

True if headers were sent, false otherwise (read-only).

Link copied to clipboard
abstract val id: Double?

The numeric stream identifier of this Http2Stream instance. Set to undefined if the stream identifier has not yet been assigned.

Link copied to clipboard
abstract val pending: Boolean

Set to true if the Http2Stream instance has not yet been assigned a numeric stream identifier.

Link copied to clipboard
abstract val pushAllowed: Boolean

Read-only property mapped to the SETTINGS_ENABLE_PUSH flag of the remote client's most recent SETTINGS frame. Will be true if the remote peer accepts push streams, false otherwise. Settings are the same for every Http2Stream in the same Http2Session.

Link copied to clipboard
open override var readable: Boolean

Is true if it is safe to call {@link read}, which means the stream has not been destroyed or emitted 'error' or 'end'.

Link copied to clipboard

Returns whether the stream was destroyed or errored before emitting 'end'.

Link copied to clipboard

Returns whether 'data' has been emitted.

Link copied to clipboard

Getter for the property encoding of a given Readable stream. The encoding property can be set using the {@link setEncoding} method.

Link copied to clipboard

Becomes true when 'end' event is emitted.

Link copied to clipboard

This property reflects the current state of a Readable stream as described in the Three states section.

Link copied to clipboard

Returns the value of highWaterMark passed when creating this Readable.

Link copied to clipboard

This property contains the number of bytes (or objects) in the queue ready to be read. The value provides introspection data regarding the status of the highWaterMark.

Link copied to clipboard

Getter for the property objectMode of a given Readable stream.

Link copied to clipboard

Set to true if the Http2Stream instance has been destroyed and is no longer usable.

Link copied to clipboard

Is true if it is safe to call writable.write(), which means the stream has not been destroyed, errored, or ended.

Link copied to clipboard
abstract val rstCode: Double

Set to the RST_STREAM error code reported when the Http2Stream is destroyed after either receiving an RST_STREAM frame from the connected peer, calling http2stream.close(), or http2stream.destroy(). Will be undefined if the Http2Stream has not been closed.

Link copied to clipboard

An object containing the outbound headers sent for this Http2Stream.

Link copied to clipboard

An array of objects containing the outbound informational (additional) headers sent for this Http2Stream.

Link copied to clipboard

An object containing the outbound trailers sent for this HttpStream.

Link copied to clipboard
abstract val session: Http2Session?

A reference to the Http2Session instance that owns this Http2Stream. The value will be undefined after the Http2Stream instance is destroyed.

Link copied to clipboard
abstract val state: StreamState

Provides miscellaneous information about the current state of the Http2Stream.

Link copied to clipboard
open override var writable: Boolean
Link copied to clipboard
open override val writableCorked: Double

Number of times writable.uncork() needs to be called in order to fully uncork the stream.

Link copied to clipboard
open override val writableEnded: Boolean

Is true after writable.end() has been called. This property does not indicate whether the data has been flushed, for this use writable.writableFinished instead.

Link copied to clipboard
open override val writableFinished: Boolean

Is set to true immediately before the 'finish' event is emitted.

Link copied to clipboard
open override val writableHighWaterMark: Double

Return the value of highWaterMark passed when creating this Writable.

Link copied to clipboard
open override val writableLength: Double

This property contains the number of bytes (or objects) in the queue ready to be written. The value provides introspection data regarding the status of the highWaterMark.

Link copied to clipboard
open override val writableNeedDrain: Boolean

Is true if the stream's buffer has been full and stream will emit 'drain'.

Link copied to clipboard
open override val writableObjectMode: Boolean

Getter for the property objectMode of a given Writable stream.

Functions

Link copied to clipboard
open override fun _destroy(error: JsError?, callback: (JsError?) -> Unit)
Link copied to clipboard
open override fun _final(callback: (JsError?) -> Unit)
Link copied to clipboard
fun _read(size: Number)
Link copied to clipboard
open override fun _write(chunk: Any?, encoding: BufferEncoding, callback: (JsError?) -> Unit)
Link copied to clipboard
abstract fun additionalHeaders(headers: OutgoingHttpHeaders)

Sends an additional informational HEADERS frame to the connected HTTP/2 peer.

Link copied to clipboard
abstract override fun addListener(event: Symbol, listener: Function<Unit>)
abstract override fun addListener(event: String, listener: Function<Unit>)
abstract fun addListener(event: Http2StreamEvent.ABORTED, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.CLOSE, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.DATA, listener: (chunk: Any) -> Unit)
abstract fun addListener(event: Http2StreamEvent.DRAIN, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.END, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.ERROR, listener: (JsError) -> Unit)
abstract fun addListener(event: Http2StreamEvent.FINISH, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.FRAMEERROR, listener: (frameType: Double, errorCode: Double) -> Unit)
abstract fun addListener(event: Http2StreamEvent.PIPE, listener: (src: Readable) -> Unit)
abstract fun addListener(event: Http2StreamEvent.STREAMCLOSED, listener: (code: Double) -> Unit)
abstract fun addListener(event: Http2StreamEvent.TIMEOUT, listener: () -> Unit)
abstract fun addListener(event: Http2StreamEvent.TRAILERS, listener: (trailers: IncomingHttpHeaders, flags: Double) -> Unit)
abstract fun addListener(event: Http2StreamEvent.UNPIPE, listener: (src: Readable) -> Unit)
abstract fun addListener(event: Http2StreamEvent.WANTTRAILERS, listener: () -> Unit)
fun addListener(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun addListener(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun addListener(event: DuplexEvent.END, listener: () -> Unit)
fun addListener(event: DuplexEvent.ERROR, listener: (JsError) -> Unit)
fun addListener(event: DuplexEvent.FINISH, listener: () -> Unit)
fun addListener(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun addListener(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun addListener(event: DuplexEvent.READABLE, listener: () -> Unit)
fun addListener(event: DuplexEvent.RESUME, listener: () -> Unit)
fun addListener(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun addListener(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun addListener(event: ReadableEvent.END, listener: () -> Unit)
fun addListener(event: ReadableEvent.ERROR, listener: (JsError) -> Unit)
fun addListener(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun addListener(event: ReadableEvent.READABLE, listener: () -> Unit)
fun addListener(event: ReadableEvent.RESUME, listener: () -> Unit)
fun addListener(event: WritableEvent.DRAIN, listener: () -> Unit)
fun addListener(event: WritableEvent.ERROR, listener: (JsError) -> Unit)
fun addListener(event: WritableEvent.FINISH, listener: () -> Unit)
fun addListener(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun addListener(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)

fun addListener(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun addListener(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun addListener(event: WritableEvent.CLOSE, listener: () -> Unit)

Event emitter The defined events on documents including:

Link copied to clipboard
fun asIndexedPairs(options: ArrayOptions = definedExternally): Readable

This method returns a new stream with chunks of the underlying stream paired with a counter in the form [index, chunk]. The first index value is 0 and it increases by 1 for each chunk produced.

Link copied to clipboard
abstract fun close(code: Number = definedExternally, callback: () -> Unit = definedExternally)

Closes the Http2Stream instance by sending an RST_STREAM frame to the connected HTTP/2 peer.

Link copied to clipboard
open fun <T : ReadableStream> compose(stream: T, options: StreamComposeOptions = definedExternally): T
open fun <T : ReadableStream> compose(stream: AsyncIterable<T>, options: StreamComposeOptions = definedExternally): T
open fun <T : ReadableStream> compose(stream: JsIterable<T>, options: StreamComposeOptions = definedExternally): T
open fun <T : ReadableStream> compose(stream: ComposeFnParam, options: StreamComposeOptions = definedExternally): T
Link copied to clipboard
open override fun cork()

The writable.cork() method forces all written data to be buffered in memory. The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.

Link copied to clipboard
open override fun destroy()

Destroy the stream. Optionally emit an 'error' event, and emit a 'close' event (unless emitClose is set to false). After this call, the readable stream will release any internal resources and subsequent calls to push() will be ignored.

open override fun destroy(error: JsError)
Link copied to clipboard
fun drop(limit: Number, options: ArrayOptions = definedExternally): Readable

This method returns a new stream with the first limit chunks dropped from the start.

Link copied to clipboard
abstract fun emit(event: Http2StreamEvent.ABORTED): Boolean
abstract fun emit(event: Http2StreamEvent.CLOSE): Boolean
abstract fun emit(event: Http2StreamEvent.DRAIN): Boolean
abstract fun emit(event: Http2StreamEvent.END): Boolean
abstract fun emit(event: Http2StreamEvent.FINISH): Boolean
abstract fun emit(event: Http2StreamEvent.TIMEOUT): Boolean
abstract override fun emit(event: Symbol, vararg args: Any?): Boolean
abstract override fun emit(event: String, vararg args: Any?): Boolean
abstract fun emit(event: Http2StreamEvent.DATA, chunk: String): Boolean
abstract fun emit(event: Http2StreamEvent.DATA, chunk: Buffer): Boolean
abstract fun emit(event: Http2StreamEvent.ERROR, err: JsError): Boolean
abstract fun emit(event: Http2StreamEvent.PIPE, src: Readable): Boolean
abstract fun emit(event: Http2StreamEvent.STREAMCLOSED, code: Number): Boolean
abstract fun emit(event: Http2StreamEvent.UNPIPE, src: Readable): Boolean
abstract fun emit(event: Http2StreamEvent.FRAMEERROR, frameType: Number, errorCode: Number): Boolean
abstract fun emit(event: Http2StreamEvent.TRAILERS, trailers: IncomingHttpHeaders, flags: Number): Boolean
fun emit(event: DuplexEvent.DATA, chunk: Any?): Boolean
fun emit(event: ReadableEvent.DATA, chunk: Any?): Boolean
Link copied to clipboard
open override fun end(cb: () -> Unit)

Calling the writable.end() method signals that no more data will be written to the Writable. The optional chunk and encoding arguments allow one final additional chunk of data to be written immediately before closing the stream.

open override fun end(chunk: Any?, cb: () -> Unit)
open override fun end(chunk: Any?, encoding: BufferEncoding, cb: () -> Unit)
open override fun end(data: Uint8Array, cb: () -> Unit)
open override fun end(data: String, cb: () -> Unit)
open override fun end(str: String, encoding: BufferEncoding, cb: () -> Unit)
Link copied to clipboard

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

Link copied to clipboard
fun every(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Boolean>, options: ArrayOptions = definedExternally): Promise<Boolean>

This method is similar to Array.prototype.every and calls fn on each chunk in the stream to check if all awaited return values are truthy value for fn. Once an fn call on a chunk awaited return value is falsy, the stream is destroyed and the promise is fulfilled with false. If all of the fn calls on the chunks return a truthy value, the promise is fulfilled with true.

Link copied to clipboard
fun filter(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Boolean>, options: ArrayOptions = definedExternally): Readable

This method allows filtering the stream. For each chunk in the stream the fn function will be called and if it returns a truthy value, the chunk will be passed to the result stream. If the fn function returns a promise - that promise will be awaited.

Link copied to clipboard
fun find(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Boolean>, options: ArrayOptions = definedExternally): Promise<Any?>

fun <T> find(fn: (data: Any?, options: ArrayOptions?) -> Boolean, options: ArrayOptions = definedExternally): Promise<T?>

This method is similar to Array.prototype.find and calls fn on each chunk in the stream to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.

Link copied to clipboard
fun flatMap(fn: (data: Any?, options: ArrayOptions?) -> Any?, options: ArrayOptions = definedExternally): Readable

This method returns a new stream by applying the given callback to each chunk of the stream and then flattening the result.

Link copied to clipboard
fun forEach(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Void>, options: ArrayOptions = definedExternally): Promise<Void>

This method allows iterating a stream. For each chunk in the stream the fn function will be called. If the fn function returns a promise - that promise will be awaited.

Link copied to clipboard

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link defaultMaxListeners}.

Link copied to clipboard
open override fun isPaused(): Boolean

The readable.isPaused() method returns the current operating state of the Readable. This is used primarily by the mechanism that underlies the readable.pipe() method. In most typical cases, there will be no reason to use this method directly.

Link copied to clipboard
fun iterator(options: ReadableBaseIteratorOptions = definedExternally): AsyncIterator<Any?>

The iterator created by this method gives users the option to cancel the destruction of the stream if the for await...of loop is exited by return, break, or throw, or if the iterator should destroy the stream if the stream emitted an error during iteration.

Link copied to clipboard
fun map(fn: (data: Any?, options: ArrayOptions?) -> Any?, options: ArrayOptions = definedExternally): Readable

This method allows mapping over the stream. The fn function will be called for every chunk in the stream. If the fn function returns a promise - that promise will be awaited before being passed to the result stream.

Link copied to clipboard
abstract override fun on(event: Symbol, listener: Function<Unit>)
abstract override fun on(event: String, listener: Function<Unit>)
abstract fun on(event: Http2StreamEvent.ABORTED, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.CLOSE, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.DATA, listener: (chunk: Any) -> Unit)
abstract fun on(event: Http2StreamEvent.DRAIN, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.END, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.ERROR, listener: (JsError) -> Unit)
abstract fun on(event: Http2StreamEvent.FINISH, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.FRAMEERROR, listener: (frameType: Double, errorCode: Double) -> Unit)
abstract fun on(event: Http2StreamEvent.PIPE, listener: (src: Readable) -> Unit)
abstract fun on(event: Http2StreamEvent.STREAMCLOSED, listener: (code: Double) -> Unit)
abstract fun on(event: Http2StreamEvent.TIMEOUT, listener: () -> Unit)
abstract fun on(event: Http2StreamEvent.TRAILERS, listener: (trailers: IncomingHttpHeaders, flags: Double) -> Unit)
abstract fun on(event: Http2StreamEvent.UNPIPE, listener: (src: Readable) -> Unit)
abstract fun on(event: Http2StreamEvent.WANTTRAILERS, listener: () -> Unit)
fun on(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun on(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun on(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun on(event: DuplexEvent.END, listener: () -> Unit)
fun on(event: DuplexEvent.ERROR, listener: (JsError) -> Unit)
fun on(event: DuplexEvent.FINISH, listener: () -> Unit)
fun on(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun on(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun on(event: DuplexEvent.READABLE, listener: () -> Unit)
fun on(event: DuplexEvent.RESUME, listener: () -> Unit)
fun on(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun on(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun on(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun on(event: ReadableEvent.END, listener: () -> Unit)
fun on(event: ReadableEvent.ERROR, listener: (JsError) -> Unit)
fun on(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun on(event: ReadableEvent.READABLE, listener: () -> Unit)
fun on(event: ReadableEvent.RESUME, listener: () -> Unit)
fun on(event: WritableEvent.CLOSE, listener: () -> Unit)
fun on(event: WritableEvent.DRAIN, listener: () -> Unit)
fun on(event: WritableEvent.ERROR, listener: (JsError) -> Unit)
fun on(event: WritableEvent.FINISH, listener: () -> Unit)
fun on(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun on(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)
Link copied to clipboard
abstract override fun once(event: Symbol, listener: Function<Unit>)
abstract override fun once(event: String, listener: Function<Unit>)
abstract fun once(event: Http2StreamEvent.ABORTED, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.CLOSE, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.DATA, listener: (chunk: Any) -> Unit)
abstract fun once(event: Http2StreamEvent.DRAIN, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.END, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.ERROR, listener: (JsError) -> Unit)
abstract fun once(event: Http2StreamEvent.FINISH, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.FRAMEERROR, listener: (frameType: Double, errorCode: Double) -> Unit)
abstract fun once(event: Http2StreamEvent.PIPE, listener: (src: Readable) -> Unit)
abstract fun once(event: Http2StreamEvent.STREAMCLOSED, listener: (code: Double) -> Unit)
abstract fun once(event: Http2StreamEvent.TIMEOUT, listener: () -> Unit)
abstract fun once(event: Http2StreamEvent.TRAILERS, listener: (trailers: IncomingHttpHeaders, flags: Double) -> Unit)
abstract fun once(event: Http2StreamEvent.UNPIPE, listener: (src: Readable) -> Unit)
abstract fun once(event: Http2StreamEvent.WANTTRAILERS, listener: () -> Unit)
fun once(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun once(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun once(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun once(event: DuplexEvent.END, listener: () -> Unit)
fun once(event: DuplexEvent.ERROR, listener: (JsError) -> Unit)
fun once(event: DuplexEvent.FINISH, listener: () -> Unit)
fun once(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun once(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun once(event: DuplexEvent.READABLE, listener: () -> Unit)
fun once(event: DuplexEvent.RESUME, listener: () -> Unit)
fun once(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun once(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun once(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun once(event: ReadableEvent.END, listener: () -> Unit)
fun once(event: ReadableEvent.ERROR, listener: (JsError) -> Unit)
fun once(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun once(event: ReadableEvent.READABLE, listener: () -> Unit)
fun once(event: ReadableEvent.RESUME, listener: () -> Unit)
fun once(event: WritableEvent.CLOSE, listener: () -> Unit)
fun once(event: WritableEvent.DRAIN, listener: () -> Unit)
fun once(event: WritableEvent.ERROR, listener: (JsError) -> Unit)
fun once(event: WritableEvent.FINISH, listener: () -> Unit)
fun once(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun once(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)
Link copied to clipboard
open override fun pause()

The readable.pause() method will cause a stream in flowing mode to stop emitting 'data' events, switching out of flowing mode. Any data that becomes available will remain in the internal buffer.

Link copied to clipboard
open override fun <T : WritableStream> pipe(destination: T, options: ReadableStreamPipeOptions): T
fun <T : WritableStream> pipe(destination: T, options: StreamPipeOptions = definedExternally): T
Link copied to clipboard
abstract override fun prependListener(event: Symbol, listener: Function<Unit>)
abstract override fun prependListener(event: String, listener: Function<Unit>)
abstract fun prependListener(event: Http2StreamEvent.ABORTED, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.CLOSE, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.DATA, listener: (chunk: Any) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.DRAIN, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.END, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.ERROR, listener: (JsError) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.FINISH, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.FRAMEERROR, listener: (frameType: Double, errorCode: Double) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.PIPE, listener: (src: Readable) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.STREAMCLOSED, listener: (code: Double) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.TIMEOUT, listener: () -> Unit)
abstract fun prependListener(event: Http2StreamEvent.TRAILERS, listener: (trailers: IncomingHttpHeaders, flags: Double) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.UNPIPE, listener: (src: Readable) -> Unit)
abstract fun prependListener(event: Http2StreamEvent.WANTTRAILERS, listener: () -> Unit)
fun prependListener(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun prependListener(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun prependListener(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun prependListener(event: DuplexEvent.END, listener: () -> Unit)
fun prependListener(event: DuplexEvent.ERROR, listener: (JsError) -> Unit)
fun prependListener(event: DuplexEvent.FINISH, listener: () -> Unit)
fun prependListener(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun prependListener(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun prependListener(event: DuplexEvent.READABLE, listener: () -> Unit)
fun prependListener(event: DuplexEvent.RESUME, listener: () -> Unit)
fun prependListener(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun prependListener(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun prependListener(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun prependListener(event: ReadableEvent.END, listener: () -> Unit)
fun prependListener(event: ReadableEvent.ERROR, listener: (JsError) -> Unit)
fun prependListener(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun prependListener(event: ReadableEvent.READABLE, listener: () -> Unit)
fun prependListener(event: ReadableEvent.RESUME, listener: () -> Unit)
fun prependListener(event: WritableEvent.CLOSE, listener: () -> Unit)
fun prependListener(event: WritableEvent.DRAIN, listener: () -> Unit)
fun prependListener(event: WritableEvent.ERROR, listener: (JsError) -> Unit)
fun prependListener(event: WritableEvent.FINISH, listener: () -> Unit)
fun prependListener(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun prependListener(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)
Link copied to clipboard
abstract override fun prependOnceListener(event: Symbol, listener: Function<Unit>)
abstract override fun prependOnceListener(event: String, listener: Function<Unit>)
abstract fun prependOnceListener(event: Http2StreamEvent.ABORTED, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.CLOSE, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.DATA, listener: (chunk: Any) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.DRAIN, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.END, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.ERROR, listener: (JsError) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.FINISH, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.FRAMEERROR, listener: (frameType: Double, errorCode: Double) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.PIPE, listener: (src: Readable) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.STREAMCLOSED, listener: (code: Double) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.TIMEOUT, listener: () -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.TRAILERS, listener: (trailers: IncomingHttpHeaders, flags: Double) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.UNPIPE, listener: (src: Readable) -> Unit)
abstract fun prependOnceListener(event: Http2StreamEvent.WANTTRAILERS, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun prependOnceListener(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.END, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.FINISH, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun prependOnceListener(event: DuplexEvent.READABLE, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.RESUME, listener: () -> Unit)
fun prependOnceListener(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun prependOnceListener(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun prependOnceListener(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun prependOnceListener(event: ReadableEvent.END, listener: () -> Unit)
fun prependOnceListener(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun prependOnceListener(event: ReadableEvent.READABLE, listener: () -> Unit)
fun prependOnceListener(event: ReadableEvent.RESUME, listener: () -> Unit)
fun prependOnceListener(event: WritableEvent.CLOSE, listener: () -> Unit)
fun prependOnceListener(event: WritableEvent.DRAIN, listener: () -> Unit)
fun prependOnceListener(event: WritableEvent.FINISH, listener: () -> Unit)
fun prependOnceListener(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun prependOnceListener(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)
Link copied to clipboard
abstract fun priority(options: StreamPriorityOptions)

Updates the priority for this Http2Stream instance.

Link copied to clipboard
fun push(chunk: Any?, encoding: BufferEncoding = definedExternally): Boolean
Link copied to clipboard
abstract fun pushStream(headers: OutgoingHttpHeaders, callback: (JsError?, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) -> Unit = definedExternally)

Initiates a push stream. The callback is invoked with the new Http2Stream instance created for the push stream passed as the second argument, or an Error passed as the first argument.

abstract fun pushStream(headers: OutgoingHttpHeaders, options: StreamPriorityOptions = definedExternally, callback: (JsError?, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) -> Unit = definedExternally)
Link copied to clipboard
open override fun read(size: Number): Any

Calls readable.destroy() with an AbortError and returns a promise that fulfills when the stream is finished.

Link copied to clipboard
open fun readOrNull(size: Number = definedExternally): Any?

The readable.read() method reads data out of the internal buffer and returns it. If no data is available to be read, null is returned. By default, the data is returned as a Buffer object unless an encoding has been specified using the readable.setEncoding() method or the stream is operating in object mode.

Link copied to clipboard
fun <T> reduce(fn: (previous: T, data: Any?, options: ArrayOptions?) -> T, initial: T, options: ArrayOptions = definedExternally): Promise<T>

fun <T> reduce(fn: (previous: Any?, data: Any?, options: ArrayOptions?) -> T, initial: Nothing? = definedExternally, options: ArrayOptions = definedExternally): Promise<T>

This method calls fn on each chunk of the stream in order, passing it the result from the calculation on the previous element. It returns a promise for the final value of the reduction.

Link copied to clipboard
open override fun removeListener(event: Symbol, listener: Function<Unit>)
open override fun removeListener(event: String, listener: Function<Unit>)
fun removeListener(event: DuplexEvent.CLOSE, listener: () -> Unit)
fun removeListener(event: DuplexEvent.DATA, listener: (chunk: Any?) -> Unit)
fun removeListener(event: DuplexEvent.DRAIN, listener: () -> Unit)
fun removeListener(event: DuplexEvent.END, listener: () -> Unit)
fun removeListener(event: DuplexEvent.ERROR, listener: (JsError) -> Unit)
fun removeListener(event: DuplexEvent.FINISH, listener: () -> Unit)
fun removeListener(event: DuplexEvent.PAUSE, listener: () -> Unit)
fun removeListener(event: DuplexEvent.PIPE, listener: (src: Readable) -> Unit)
fun removeListener(event: DuplexEvent.READABLE, listener: () -> Unit)
fun removeListener(event: DuplexEvent.RESUME, listener: () -> Unit)
fun removeListener(event: DuplexEvent.UNPIPE, listener: (src: Readable) -> Unit)
fun removeListener(event: ReadableEvent.CLOSE, listener: () -> Unit)
fun removeListener(event: ReadableEvent.DATA, listener: (chunk: Any?) -> Unit)
fun removeListener(event: ReadableEvent.END, listener: () -> Unit)
fun removeListener(event: ReadableEvent.ERROR, listener: (JsError) -> Unit)
fun removeListener(event: ReadableEvent.PAUSE, listener: () -> Unit)
fun removeListener(event: ReadableEvent.READABLE, listener: () -> Unit)
fun removeListener(event: ReadableEvent.RESUME, listener: () -> Unit)
fun removeListener(event: WritableEvent.CLOSE, listener: () -> Unit)
fun removeListener(event: WritableEvent.DRAIN, listener: () -> Unit)
fun removeListener(event: WritableEvent.ERROR, listener: (JsError) -> Unit)
fun removeListener(event: WritableEvent.FINISH, listener: () -> Unit)
fun removeListener(event: WritableEvent.PIPE, listener: (src: Readable) -> Unit)
fun removeListener(event: WritableEvent.UNPIPE, listener: (src: Readable) -> Unit)
Link copied to clipboard
abstract fun respond(headers: OutgoingHttpHeaders = definedExternally, options: ServerStreamResponseOptions = definedExternally)

Initiates a response. When the options.waitForTrailers option is set, the'wantTrailers' event will be emitted immediately after queuing the last chunk of payload data to be sent. The http2stream.sendTrailers() method can then be used to sent trailing header fields to the peer.

Link copied to clipboard
abstract fun respondWithFD(fd: Double, headers: OutgoingHttpHeaders = definedExternally, options: ServerStreamFileResponseOptions = definedExternally)
abstract fun respondWithFD(fd: FileHandle, headers: OutgoingHttpHeaders = definedExternally, options: ServerStreamFileResponseOptions = definedExternally)

Initiates a response whose data is read from the given file descriptor. No validation is performed on the given file descriptor. If an error occurs while attempting to read data using the file descriptor, the Http2Stream will be closed using an RST_STREAM frame using the standard INTERNAL_ERROR code.

Link copied to clipboard
abstract fun respondWithFile(path: String, headers: OutgoingHttpHeaders = definedExternally, options: ServerStreamFileResponseOptionsWithError = definedExternally)

Sends a regular file as the response. The path must specify a regular file or an 'error' event will be emitted on the Http2Stream object.

Link copied to clipboard
open override fun resume()

The readable.resume() method causes an explicitly paused Readable stream to resume emitting 'data' events, switching the stream into flowing mode.

Link copied to clipboard
abstract fun sendTrailers(headers: OutgoingHttpHeaders)

Sends a trailing HEADERS frame to the connected HTTP/2 peer. This method will cause the Http2Stream to be immediately closed and must only be called after the 'wantTrailers' event has been emitted. When sending a request or sending a response, the options.waitForTrailers option must be set in order to keep the Http2Stream open after the final DATA frame so that trailers can be sent.

Link copied to clipboard
open override fun setDefaultEncoding(encoding: BufferEncoding)

The writable.setDefaultEncoding() method sets the default encoding for a Writable stream.

Link copied to clipboard
open override fun setEncoding(encoding: BufferEncoding)

The readable.setEncoding() method sets the character encoding for data read from the Readable stream.

Link copied to clipboard

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

Link copied to clipboard
abstract fun setTimeout(msecs: Number, callback: () -> Unit = definedExternally)
Link copied to clipboard
fun some(fn: (data: Any?, options: ArrayOptions?) -> PromiseResult<Boolean>, options: ArrayOptions = definedExternally): Promise<Boolean>

This method is similar to Array.prototype.some and calls fn on each chunk in the stream until the awaited return value is true (or any truthy value). Once an fn call on a chunk awaited return value is truthy, the stream is destroyed and the promise is fulfilled with true. If none of the fn calls on the chunks return a truthy value, the promise is fulfilled with false.

Link copied to clipboard
fun take(limit: Number, options: ArrayOptions = definedExternally): Readable

This method returns a new stream with the first limit chunks.

Link copied to clipboard
fun toArray(options: ArrayOptions = definedExternally): Promise<ReadonlyArray<Any?>>

This method allows easily obtaining the contents of a stream.

Link copied to clipboard
open override fun uncork()

The writable.uncork() method flushes all data buffered since {@link cork} was called.

Link copied to clipboard
open override fun unpipe(destination: WritableStream)

The readable.unpipe() method detaches a Writable stream previously attached using the {@link pipe} method.

Link copied to clipboard
open override fun unshift(chunk: Uint8Array, encoding: BufferEncoding)
open override fun unshift(chunk: String, encoding: BufferEncoding)

fun unshift(chunk: Any?, encoding: BufferEncoding = definedExternally)

Passing chunk as null signals the end of the stream (EOF) and behaves the same as readable.push(null), after which no more data can be written. The EOF signal is put at the end of the buffer and any buffered data will still be flushed.

Link copied to clipboard
open override fun wrap(stream: ReadableStream)

Prior to Node.js 0.10, streams did not implement the entire node:stream module API as it is currently defined. (See Compatibility for more information.)

Link copied to clipboard
open override fun write(chunk: Any?, callback: (JsError?) -> Unit): Boolean

The writable.write() method writes some data to the stream, and calls the supplied callback once the data has been fully handled. If an error occurs, the callback will be called with the error as its first argument. The callback is called asynchronously and before 'error' is emitted.

open override fun write(chunk: Any?, encoding: BufferEncoding, callback: (JsError?) -> Unit): Boolean
open override fun write(buffer: Uint8Array, cb: (JsError?) -> Unit): Boolean
open override fun write(buffer: String, cb: (JsError?) -> Unit): Boolean
open override fun write(str: String, encoding: BufferEncoding, cb: (JsError?) -> Unit): Boolean