An abstraction for writing streaming data.

Data will be buffered in an internal queue before being written to the underlying sink

Details

Events:

  • start

  • error

  • drain

  • backpressure

  • close

See also

Super class

streams::EventEmitter -> WriteableStream

Active bindings

current_state

1

is_ready

1

is_locked

1

controller

1

desired_size

1

Methods

Inherited methods


Method new()

Create a new ReadableStream

Usage

WriteableStream$new(
  start = NULL,
  write = NULL,
  flush = NULL,
  abort = NULL,
  queue_strategy = NULL
)

Arguments

start

a function that is called once the stream enters the "started" state

write

a function that is called whenever the stream attempts to write to the underlying source

flush

a function that is called prior to the stream ending

abort

a function that is called to immediately abort the stream, dropping all unconsumed chunks in the process

queue_strategy

a QueueStrategy object, describing how chunks will be buffered by the stream


Method write()

1

Usage

WriteableStream$write(chunk)

Arguments

chunk

data

Returns

NULL


Method abort()

1

Usage

WriteableStream$abort()

Returns

NULL


Method close()

1

Usage

WriteableStream$close()

Returns

NULL


Method lock_stream()

1

Usage

WriteableStream$lock_stream(x)

Arguments

x

1

Returns

NULL


Method print()

1

Usage

WriteableStream$print()

Returns

NULL


Method format()

1

Usage

WriteableStream$format(...)

Arguments

...

1

Returns

NULL