Skip to content

fzankl/grpc-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC Sample

Example how to work with gRPC using .NET Core/ASP.NET Core and Python.


This example shows how to work with gRPC using .NET and Python. gRPC Server is provided by an ASP.NET Core backend. Each client shows then how to connect and interact with this server.

Examples consider all available communication patters of gRPC:

  • Unary RPCs
  • Server streaming RPCs
  • Client streaming RPCs
  • Bidirectional streaming RPCs

Current state of implementation:

  • ASP.NET Core Server
    • Unary RPC
    • Server streaming RPC
    • Client streaming RPC
    • Bidirectional streaming
  • ASP.NET Core Client
    • Unary RPC
    • Server streaming RPC
    • Client streaming RPC
    • Bidirectional streaming
  • Python Client (in progress)
    • Unary RPC
    • Server streaming RPC
    • Client streaming RPC
    • Bidirectional streaming

Further information: https://www.fzankl.de/en/blog/distributed-services-using-grpc-in-dotnet-and-python

How to run this sample

To run this sample you have to start the ASP.NET Core Server project first. Navigate to src\ASP.NET Core - GrpcServer inside the repository and run following command (Requires .NET Core Runtime installed):

dotnet run

After that you can start the client you prefer, e.g. the .NET Core gRPC client application as shown in following figure:

Output from .NET Core client application