{"id":13741679,"url":"https://github.com/ridha/grpc-streaming-demo","last_synced_at":"2025-04-28T02:32:01.496Z","repository":{"id":61644023,"uuid":"84404543","full_name":"ridha/grpc-streaming-demo","owner":"ridha","description":"A quick demo of bi-directional streaming RPC's using grpc, go and python3","archived":false,"fork":false,"pushed_at":"2017-03-11T16:08:41.000Z","size":202,"stargazers_count":168,"open_issues_count":0,"forks_count":37,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-05T05:33:08.299Z","etag":null,"topics":["grpc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ridha.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T06:05:36.000Z","updated_at":"2024-07-11T08:09:46.000Z","dependencies_parsed_at":"2022-10-19T07:00:13.056Z","dependency_job_id":null,"html_url":"https://github.com/ridha/grpc-streaming-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridha%2Fgrpc-streaming-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridha%2Fgrpc-streaming-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridha%2Fgrpc-streaming-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ridha%2Fgrpc-streaming-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ridha","download_url":"https://codeload.github.com/ridha/grpc-streaming-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251238199,"owners_count":21557416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grpc"],"created_at":"2024-08-03T04:01:01.679Z","updated_at":"2025-04-28T02:32:01.168Z","avatar_url":"https://github.com/ridha.png","language":"Go","funding_links":[],"categories":["Resources"],"sub_categories":["Examples"],"readme":"Streaming RPC's using gRPC\n--------------------------\n\ngRPC is a language-neutral, platform-neutral RPC framework that is quickly taking on JSON/HTTP\nas the recommended way to communicate between microservices.\n\nIts main selling points are:\n - Communication is based on HTTP2 transport. This provides all the advantages of the HTTP2 (compression, multiplexing, streaming)\n - Well-defined schemas via Protocol Buffers 3\n - Automatic client code generation for 10 different languages.\n - Bi-directional streaming\n\nBy default, gRPC uses Protocol Buffers as the Interface Definition Language (IDL) and as its underlying message interchange format.\n\nIn this project, we'll implement a simple PrimeFactorService that returns a stream of the prime factors of the numbers passed to it\nin a request.\nI decided to make my gRPC server in Go and client in Python.\nThe client program will read from stdin and will immediately push it to the service.\n\nGenerate gRPC code for server and client\n----------------------------------------\n\nWe are going to use gRPC to generate libraries for Go and Python 3.\nTo generate the Go code, you'll need to install  protoc_.\n\n.. _protoc: https://github.com/google/protobuf/#protocol-compiler-installation\n\n.. code-block:: bash\n\n # Python client\n $ pip3 install -U grpcio grpcio-tools\n $ python3 -m grpc_tools.protoc -I protobuf/ --python_out=. --grpc_python_out=. protobuf/primefactor.proto\n # Go\n $ protoc -I protobuf/ --go_out=plugins=grpc:protobuf/ protobuf/primefactor.proto\n\nThe first command will generate primefactor_pb2.py and primefactor_pb2_grpc.py.\nThe latter will generate primefactor.pb.go.\n\nTo start the server, simply run:\n\n.. code-block:: bash\n\n  go run server.go\n\nYou can run the client using:\n\n.. code-block:: bash\n\n  python3 client.py\n\n\n.. image:: demo.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridha%2Fgrpc-streaming-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fridha%2Fgrpc-streaming-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridha%2Fgrpc-streaming-demo/lists"}