TTYCast. Writer
(ttycast v0.1.0)
Copy Markdown
GenServer writer for seekable, compressed terminal recordings.
Writers receive terminal events synchronously and persist chunks to disk before
replying. Use write/2 for terminal output, input/2 for user input subject
to the configured input policy, and event/3 or marker/3 for semantic host
application data.
Most callers should use TTYCast.write/3 for scoped lifecycle management.
Summary
Functions
Returns a specification to start this module under a supervisor.
Flushes, writes the final trailer/footer, and stops the writer.
Records a custom semantic event on an application-owned stream.
Flushes the current in-memory event batch as a chunk.
Records input according to the writer input policy.
Records only the number of input bytes.
Records a named semantic marker with application-owned metadata.
Records a terminal resize.
Starts a writer process. Requires :path, :width, and :height options.
Records terminal output bytes.
Types
@type event() :: {:output, non_neg_integer(), binary()} | {:input, non_neg_integer(), binary()} | {:input_redacted, non_neg_integer(), non_neg_integer()} | {:resize, non_neg_integer(), pos_integer(), pos_integer()} | {:marker, non_neg_integer(), atom(), map()} | {:event, non_neg_integer(), atom(), term()}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(pid() | nil) :: :ok
Flushes, writes the final trailer/footer, and stops the writer.
Records a custom semantic event on an application-owned stream.
@spec flush(pid() | nil) :: :ok
Flushes the current in-memory event batch as a chunk.
@spec input(pid() | nil, IO.chardata()) :: :ok
Records input according to the writer input policy.
@spec input_redacted(pid() | nil, non_neg_integer()) :: :ok
Records only the number of input bytes.
Records a named semantic marker with application-owned metadata.
@spec output(pid() | nil, IO.chardata()) :: :ok
@spec resize(pid() | nil, pos_integer(), pos_integer()) :: :ok
Records a terminal resize.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a writer process. Requires :path, :width, and :height options.
@spec write(pid() | nil, IO.chardata()) :: :ok
Records terminal output bytes.