Get tp server and ui dev server to talk to each other
This commit is contained in:
parent
328922bd7b
commit
1cb07fb126
5 changed files with 46 additions and 29 deletions
|
|
@ -15,12 +15,13 @@ use self::{drawer::Drawer, persistent_printer::PersistentPrinter};
|
|||
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
/// Address the web server will listen at.
|
||||
addr: String,
|
||||
|
||||
/// Path to the queue directory.
|
||||
queue: PathBuf,
|
||||
|
||||
/// Address the web server will listen at.
|
||||
#[arg(long, short, default_value = "localhost:8080")]
|
||||
address: String,
|
||||
|
||||
/// Path to the printer's USB device file.
|
||||
///
|
||||
/// Usually, this is located at `/dev/usb/lp0` or a similar location.
|
||||
|
|
@ -41,7 +42,7 @@ fn main() -> anyhow::Result<()> {
|
|||
let mut drawer = Drawer::new(rx, printer);
|
||||
|
||||
let runtime = Runtime::new()?;
|
||||
runtime.spawn(server::run(tx.clone(), args.addr));
|
||||
runtime.spawn(server::run(tx.clone(), args.address));
|
||||
runtime.spawn(async move {
|
||||
loop {
|
||||
let _ = tx.send(Command::Backlog).await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue