Skip to content
greet_client.py 659 B
Newer Older
import greet_pb2_grpc
import greet_pb2
import grpc

#from tests import greet_pb2
#from tests import greet_pb2_grpc

import datetime as dt

def run():
    with grpc.insecure_channel('localhost:50051') as channel:
        stub = greet_pb2_grpc.GreeterStub(channel)
        print("The stub has been created")
        forecastRequest = greet_pb2.ForecastTopology(forecast_window_seconds = 36000, topology_id = "1" )
        print("The request has been sent to the client")
        hello_reply = stub.ComputeTopologyForecast(forecastRequest)
        print("The response has been received")
        print(hello_reply)
        


if __name__ == "__main__":
    run()