async fn publish_signals(client: &NetworkServiceClient) {
    let mut client_id = ClientId::new();
    client_id.id = "rusty_client_pub".to_string();

    print!("Enter a value: ");
    std::io::stdout().flush().ok().expect("Failed to flush output stream");

    // Take input from terminal
    let mut input_string = String::new();
    let _input_result = std::io::stdin().read_line(&mut input_string);

    // try to parse the string into int64, if fail: payload = 0
    let input_as_int: i64 = input_string.trim().parse().unwrap_or(0);

    // Create a PublisherConfig from .proto files
    let mut publisher_config = PublisherConfig::new();
    publisher_config.clientId = SingularPtrField::some(client_id);
    publisher_config.signals = generate_signals(&input_as_int);
    let _result = client.publish_signals_async(&publisher_config).unwrap().await;
}
// Publish signals to signal-broker over gRPC
Publish signals to signal-broker over gRPC
Publish signals to signal - broker over gRPC
async fn publish_signals(client: &NetworkServiceClient) {
    let mut client_id = ClientId::new();
    client_id.id = "rusty_client_pub".to_string();
    print!("Enter a value: ");
    std::io::stdout().flush().ok().expect("Failed to flush output stream");
    // Take input from terminal
    let mut input_string = String::new();
    let _input_result = std::io::stdin().read_line(&mut input_string);
    // try to parse the string into int64, if fail: payload = 0
    let input_as_int: i64 = input_string.trim().parse().unwrap_or(0);
    // Create a PublisherConfig from .proto files
    let mut publisher_config = PublisherConfig::new();
    publisher_config.clientId = SingularPtrField::some(client_id);
    publisher_config.signals = generate_signals(&input_as_int);
    let _result = client.publish_signals_async(&publisher_config).unwrap().await;
}
async fn publish_signals ( client : & NetworkServiceClient ) { let mut client_id = ClientId :: new ( ) ; client_id . id = " " . to_string ( ) ; print ! ( " " ) ; std :: io :: stdout ( ) . flush ( ) . ok ( ) . expect ( " " ) ; // Take input from terminal let mut input_string = String :: new ( ) ; let _input_result = std :: io :: stdin ( ) . read_line ( & mut input_string ) ; // try to parse the string into int64, if fail: payload = 0 let input_as_int : i64 = input_string . trim ( ) . parse ( ) . unwrap_or ( 0 ) ; // Create a PublisherConfig from .proto files let mut publisher_config = PublisherConfig :: new ( ) ; publisher_config . clientId = SingularPtrField :: some ( client_id ) ; publisher_config . signals = generate_signals ( & input_as_int ) ; let _result = client . publish_signals_async ( & publisher_config ) . unwrap ( ) . await ; }
Publish signals to signal-broker over gRPC
Publish signals to signal - broker over gRPC
client
&NetworkServiceClient