-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from ReagentX/feat/cs/readme-headings
Update readme headings
- Loading branch information
Showing
6 changed files
with
82 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
# Input Handler Documentation | ||
|
||
Input handlers run in processes parallel to the main process using Python's `multiprocessing` library. Each `InputStream` child class implements a method that creates two pipes, one for `stdin` and one for `stdout`. The data sent through these pipes are stored in a Queue, which the main process can read from to render. | ||
Input handlers run in processes parallel to the main process and communicate using Rust's `mpsc` module. Each struct that implements the `Input` trait has a method that creates two sets of `mpsc` channels, one for `stdin` and one for `stdout`. The data sent through these channels are stored until the main process can read from them. | ||
|
||
## `CommandInputStream` Objects | ||
## `CommandInput` | ||
|
||
Given a list command parts, use the `subprocess` library to open a shell, run that process, and pipe the responses back into their respective queues. | ||
Given a command, use `tokio`'s `command` module to open process and read its `stderr` and `stdout` into their respective `mpsc` channels. | ||
|
||
Commands will be parsed against your PATH variables, replacing programs you have on your path with their fully qualified path. | ||
## `FileInput` | ||
|
||
Creating a `CommandInputStream()` with `args` like `['tail', '-f', 'out.log']` will open a shell that runs `/usr/bin/tail -f out.log`. | ||
Given a file path, read the file and send the output to the `stdout` queue. | ||
|
||
## `FileInputStream` Objects | ||
|
||
Given a list that represents a file path, read in the file and send the output to the `stdout` queue. | ||
|
||
Creating a `FileInputStream()` with `args` like `["sample_streams", "accesslog"]` will read in the contents of `sample_streams/accesslog` to the `stdout` queue. | ||
Creating a `FileInput()` with `"sample_streams/accesslog"` will read in the contents of `sample_streams/accesslog` to the `stdout` queue. The path is parsed relative to the current directory when starting `logria`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters