Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    e239cad1
    Preliminary pipe support for LLProcess. · e239cad1
    Nat Goodspeed authored
    Add LLProcess::FileParam to specify how to construct each child's standard
    file slot, with lots of comments about features designed but not yet
    implemented. The point is to design it with enough flexibility to be able to
    extend to foreseeable use cases.
    Add LLProcess::Params::files to collect up to 3 FileParam items. Naturally
    this extends the accepted LLSD syntax as well.
    Implement type="" (child inherits parent file descriptor) and "pipe" (parent
    constructs anonymous pipe to pass to child).
    Add LLProcess::FILESLOT enum, plus methods:
    getReadPipe(FILESLOT), getOptReadPipe(FILESLOT)
    getWritePipe(), getOptWritePipe()
    getPipeName(FILESLOT): placeholder implementation for now
    Add LLProcess::ReadPipe and WritePipe classes, as returned by get*Pipe().
    WritePipe supports get_ostream() method for streaming to child stdin.
    ReadPipe supports get_istream() method for reading from child stdout/stderr.
    It also provides getPump() returning LLEventPump& so interested parties can
    listen for arrival of new data on the aforementioned std::istream.
    For "pipe" slots, instantiate appropriate *Pipe class.
    ReadPipe and WritePipe classes are pure virtual bases for ReadPipeImpl and
    WritePipeImpl, respectively: all implementation data are hidden in the latter
    classes, visible only in llprocess.cpp. In fact each *PipeImpl class registers
    itself for "mainloop" ticks, attempting nonblocking I/O to the underlying
    apr_file_t on each tick. Data are buffered in a boost::asio::streambuf, which
    bridges between std::[io]stream and the APR I/O calls.
    Sanity-test ReadPipeImpl by using a pipe to absorb the Python "SyntaxError"
    output from the successful syntax_error test, rather than alarming the user.
    Add first few unit tests for validating FileParam. More tests coming!
    e239cad1
    History
    Preliminary pipe support for LLProcess.
    Nat Goodspeed authored
    Add LLProcess::FileParam to specify how to construct each child's standard
    file slot, with lots of comments about features designed but not yet
    implemented. The point is to design it with enough flexibility to be able to
    extend to foreseeable use cases.
    Add LLProcess::Params::files to collect up to 3 FileParam items. Naturally
    this extends the accepted LLSD syntax as well.
    Implement type="" (child inherits parent file descriptor) and "pipe" (parent
    constructs anonymous pipe to pass to child).
    Add LLProcess::FILESLOT enum, plus methods:
    getReadPipe(FILESLOT), getOptReadPipe(FILESLOT)
    getWritePipe(), getOptWritePipe()
    getPipeName(FILESLOT): placeholder implementation for now
    Add LLProcess::ReadPipe and WritePipe classes, as returned by get*Pipe().
    WritePipe supports get_ostream() method for streaming to child stdin.
    ReadPipe supports get_istream() method for reading from child stdout/stderr.
    It also provides getPump() returning LLEventPump& so interested parties can
    listen for arrival of new data on the aforementioned std::istream.
    For "pipe" slots, instantiate appropriate *Pipe class.
    ReadPipe and WritePipe classes are pure virtual bases for ReadPipeImpl and
    WritePipeImpl, respectively: all implementation data are hidden in the latter
    classes, visible only in llprocess.cpp. In fact each *PipeImpl class registers
    itself for "mainloop" ticks, attempting nonblocking I/O to the underlying
    apr_file_t on each tick. Data are buffered in a boost::asio::streambuf, which
    bridges between std::[io]stream and the APR I/O calls.
    Sanity-test ReadPipeImpl by using a pipe to absorb the Python "SyntaxError"
    output from the successful syntax_error test, rather than alarming the user.
    Add first few unit tests for validating FileParam. More tests coming!
Code owners
Assign users and groups as approvers for specific file changes. Learn more.