Skip to content

Commit

Permalink
unbuffered subprocess (#2213)
Browse files Browse the repository at this point in the history
  • Loading branch information
turuslan authored Sep 17, 2024
1 parent e785829 commit c9ce259
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions core/parachain/pvf/workers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ namespace kagome::parachain {

struct ProcessAndPipes : std::enable_shared_from_this<ProcessAndPipes> {
AsyncPipe pipe_stdin;
boost::asio::buffered_write_stream<AsyncPipe &> writer;
// NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
AsyncPipe &writer;
AsyncPipe pipe_stdout;
boost::asio::buffered_read_stream<AsyncPipe &> reader;
// NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
AsyncPipe &reader;
boost::process::child process;
std::shared_ptr<Buffer> writing = std::make_shared<Buffer>();
std::shared_ptr<Buffer> reading = std::make_shared<Buffer>();
Expand Down Expand Up @@ -66,13 +68,7 @@ namespace kagome::parachain {
if (ec) {
return cb(ec);
}
self->writer.async_flush(
[cb](boost::system::error_code ec, size_t) mutable {
if (ec) {
return cb(ec);
}
cb(outcome::success());
});
cb(outcome::success());
});
});
}
Expand Down

0 comments on commit c9ce259

Please sign in to comment.