ReadableStream: R6 Class representing a readable connection

Description Details Super class Methods

Description

R6 Class representing a readable connection

R6 Class representing a readable connection

Details

Events:

Two types of data consumption:

Errors:

Super class

emitters::EventEmitter -> ReadableStream

Methods

Public methods

Inherited methods

Method new()

Create a new ReadableStream object

Usage
ReadableStream$new(
  source_object,
  highwater_mark = NULL,
  queue_strategy = object.size,
  encoding = "UTF8"
)
Arguments
source_object

file path, connection, processx connection, socket connection, iterator, or anything coercable to an iterator

highwater_mark

maximum buffer size

queue_strategy

the function used to determine the maximum size of the internal buffer. the buffer size is determined by calling queue_strategy(internal_buffer)

encoding

encoding used when reading from the connection

emit_close

should close be emitted when destroying the stream?

Returns

A new ReadableStream object. Print


Method print()

Pretty print a <ReadableStream> object Read from stream

Usage
ReadableStream$print()

Method read()

How many lines to read from the internal buffer. If n < 0, read all lines.

Usage
ReadableStream$read(n = -1)
Arguments
n

pipe to a writeable stream


Method pipe()

remove a pipe pointing to a writeable stream

Usage
ReadableStream$pipe(destination)
Arguments
destination

writeable stream


Method unpipe()

Pause stream

Usage
ReadableStream$unpipe(destination)
Arguments
destination

writeable stream


Method tee()

Usage
ReadableStream$tee()

Method pause()

Pause the stream, and emit a 'pause' event (if not already paused)

Usage
ReadableStream$pause()

Method resume()

Resume stream, and emit a 'resume' event (if not already flowing) Destroy stream

Usage
ReadableStream$resume()

Method unshift()

Usage
ReadableStream$unshift(chunk)

Method push()

Usage
ReadableStream$push(chunk)

Method destroy()

Destroy the stream, closing its file descriptor and emitting a close event when applicable

Usage
ReadableStream$destroy(why = NULL)
Arguments
why

a message to print when destroying the stream


ElianHugh/emitters documentation built on Feb. 6, 2022, 4:55 a.m.