Prepares and starts the loop which reads from stdin, writes to the leading log file, and manages total log size.
| 147 | // Prepares and starts the loop which reads from stdin, writes to the |
| 148 | // leading log file, and manages total log size. |
| 149 | Future<Nothing> run() |
| 150 | { |
| 151 | // NOTE: This is a prerequisuite for `io::read`. |
| 152 | Try<Nothing> async = io::prepare_async(STDIN_FILENO); |
| 153 | if (async.isError()) { |
| 154 | return Failure("Failed to set async pipe: " + async.error()); |
| 155 | } |
| 156 | |
| 157 | // NOTE: This does not block. |
| 158 | loop(); |
| 159 | |
| 160 | return promise.future(); |
| 161 | } |
| 162 | |
| 163 | // Reads from stdin and writes to the leading log file. |
| 164 | void loop() |