Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API to embed text console #381

Open
stepancheg opened this issue Oct 3, 2022 · 1 comment
Open

Provide API to embed text console #381

stepancheg opened this issue Oct 3, 2022 · 1 comment
Labels
C-console Crate: console. S-feature Severity: feature. This is adding a new feature.

Comments

@stepancheg
Copy link

What problem are you trying to solve?

We have a binary deployed to servers.

It is not always trivial to get tokio-console binary to these servers.

We'd like to embed tokio-console in the binary. With command like:

our_binary --tokio-console

That binary should just launch tokio-console.

How should the problem be solved?

tokio-console crate to implement simple public API like:

fn run(args: &[&str]) { ... }

that API will do whatever tokio-console does: connects to the server, launch text UI, interpret keyboard input etc.

Any alternatives you've considered?

Do not embed tokio-console binary.

How would users interact with this feature?

No response

Would you like to work on this feature?

maybe

@stepancheg stepancheg added the S-feature Severity: feature. This is adding a new feature. label Oct 3, 2022
@hawkw
Copy link
Member

hawkw commented Oct 3, 2022

It would definitely be possible to expose a library API to allow embedding the tokio-console TUI in another binary --- and probably fairly straightforward. We mostly haven't done this yet because there hasn't been any demand for it, and we haven't committed to an API surface for the console.

A simple interface taking a slice of arguments would be possible without making API commitments about the structure of the arguments themselves. We may also want to consider making the configuration structs that derive clap::Parser public, eventually, to support nicer programmatic configuration of an embedded console, but just taking a lsit of string arguments would be a safe starting point.

@hawkw hawkw added the C-console Crate: console. label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-console Crate: console. S-feature Severity: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants