Description Details Super class Methods
R6 Class representing a readable connection
R6 Class representing a readable connection
Events:
'data'
'readable'
'pause'
'resume'
'new_listener'
'remove_listener'
'error'
'close'
Two types of data consumption:
flowing mode
readable mode
Errors:
Errors are propogated by the event emitter, and will halt execution unless handled appropriately. If an error listener is attached, errors are caught and do not halt execution. Pipes automatically propogate errors to the right-hand-side pipe (if it exists).
emitters::EventEmitter
-> ReadableStream
new()
Create a new ReadableStream object
ReadableStream$new( source_object, highwater_mark = NULL, queue_strategy = object.size, encoding = "UTF8" )
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?
A new ReadableStream
object.
Print
print()
Pretty print a <ReadableStream> object Read from stream
ReadableStream$print()
read()
How many lines to read from the internal buffer. If n < 0, read all lines.
ReadableStream$read(n = -1)
n
pipe to a writeable stream
pipe()
remove a pipe pointing to a writeable stream
ReadableStream$pipe(destination)
destination
writeable stream
unpipe()
Pause stream
ReadableStream$unpipe(destination)
destination
writeable stream
tee()
ReadableStream$tee()
pause()
Pause the stream, and emit a 'pause' event (if not already paused)
ReadableStream$pause()
resume()
Resume stream, and emit a 'resume' event (if not already flowing) Destroy stream
ReadableStream$resume()
unshift()
ReadableStream$unshift(chunk)
push()
ReadableStream$push(chunk)
destroy()
Destroy the stream, closing its file descriptor and emitting a close event when applicable
ReadableStream$destroy(why = NULL)
why
a message to print when destroying the stream
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.