Skip to content

Commit

Permalink
Aer improvements to start some observe changes (#500)
Browse files Browse the repository at this point in the history
* add some useful logging to cells_output script

* give the observe command some useful parameters [aer]

* aer should log the most useful inner bit of the response
  • Loading branch information
dmah42 authored Feb 1, 2024
1 parent cbef2c5 commit 6256012
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 2 additions & 3 deletions aer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub mod runtime;
macro_rules! execute {
($call:path, $req:ident) => {{
let client = ::client::Client::default().await?;
let res = $call(&client, $req).await?;
let res = $call(&client, $req).await?.into_inner();
println!("{res:#?}");
res
}};
Expand All @@ -79,8 +79,7 @@ macro_rules! execute {
#[macro_export]
macro_rules! execute_server_streaming {
($call:path, $req:ident) => {{
let res = $crate::execute!($call, $req);
let mut res = res.into_inner();
let mut res = $crate::execute!($call, $req);
while let Some(res) = futures_util::StreamExt::next(&mut res).await {
let res = res?;
println!("{res:#?}");
Expand Down
7 changes: 6 additions & 1 deletion aer/src/observe/observe_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@
* *
\* -------------------------------------------------------------------------- */

macros::subcommand!("../api/v0/observe/observe.proto", observe, ObserveService);
macros::subcommand!("../api/v0/observe/observe.proto", observe, ObserveService,
GetSubProcessStream {
process_id[required = true, alias = "pid"],
channel_type[default_value = "1"], // default to stdout
},
);
4 changes: 2 additions & 2 deletions api/v0/observe/observe.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ message Signal {
message GetAuraeDaemonLogStreamRequest {
}

// TODO: not implemented
// TODO: not implemented in auraescript
message GetSubProcessStreamRequest {
LogChannelType channel_type = 1;
int32 process_id = 2;
LogChannelType channel_type = 1;
}

message LogItem {
Expand Down
3 changes: 2 additions & 1 deletion examples/cells_output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let started_out = await cellService.start(<cells.CellServiceStartRequest>{
name: "echo-stdout"
})
})
//console.log(started_out)
console.log(started_out)

// [ Start ]
let started_err = await cellService.start(<cells.CellServiceStartRequest>{
Expand All @@ -69,6 +69,7 @@ let started_err = await cellService.start(<cells.CellServiceStartRequest>{
name: "echo-stderr"
})
})
console.log(started_err)

// [ Stop ]
let stopped_out = await cellService.stop(<cells.CellServiceStopRequest>{
Expand Down

0 comments on commit 6256012

Please sign in to comment.