pub struct PersistentWriter(/* private fields */);Expand description
A Writer “lock” for a PersistentChild.
This struct will send bytes to the stdin of a
PersistentChild. This is done indirectly through a
LocalSocketStream, since the child process doesn’t have
direct access to the stdin of the child, as it belongs to the
parent process.
This writer is more of a “writer lock” over the actual inner writer. This is because of reloads.
When duat reloads, the child process is finished. This could
prematurely end write calls of separate threads, leading to
the loss, duplication, or corruption of data.
That’s why this struct has the PersistentWriter::on_writer
method. This method will give you mutable access to the writer
while preventing duat from reloading.
You should make use of it in order to “confirm” that a value has actually been written. Any confirmation outside of this method can’t be trusted.