cyanfish / grpc-dotnet-namedpipes

Named pipe transport for gRPC in C#/.NET
Apache License 2.0
190 stars 48 forks source link

Code-first support #18

Open netcorefan1 opened 3 years ago

netcorefan1 commented 3 years ago

Hello, I want to congratulate with the author for this ingenious project. I compared with the official version which uses UnixSocket and this one is much faster. I couldn't understand why this has not been merged into the official!

I am trying to implement your lib in MagicOnion, but I can't find a BinderService. I like the fact that it supports MessagePack and code-first support, but it still rely on Http/2 and is slower. Another one is protobuf-net.Grpc. Is there a way to make it work with these two frameworks?

cyanfish commented 3 years ago

Thanks for the kind words!

Looks like the client side is simple for both (just use NamedPipeChannel in place of GrpcChannel.Create in their samples). I had a look at protobuf-net.Grpc on the server side and it would need: 1) Implement the protobuf-net ServerBinder as NamedPipeServerBinder that wraps NamedPipeServer.ServiceBinder 2) Create a .Bind<IService>() extension method on NamedPipeServer that calls new NamedPipeServerBinder().Bind<IService>(namedPipeServer)

As far as MagicOnion, I haven't dived into it, but there should be something roughly equivalent. Conceptually the idea is that you need to create a NamedPipeServer and then use its ServiceBinder to map service method descriptions to implementations. I'm also open to PRs that tweak the API if that makes it easier.

netcorefan1 commented 3 years ago

Sorry for my delay, but I have been very busy. It's good to know that should be possible although actually I am more focused in another project which to me seemed the best of all the ones I found. It's called SciTechRpc. They also developed a tool that automatically generate assemblies eliminating in this way the slow start up caused from dynamic generation. You may want to take a look at it, you could find interesting things. If you like it you may establish some sort of cooperation. He is open mind and a very nice person. I saw lot of projects of this kind here in github and I am sure this one is the best and I will stuck with it. Thanks

ashisha690 commented 1 year ago

@cyanfish I was looking at this repository and I am curious to know why a CustomSerializer was added while upgrading the grpc packages instead of relying on the marshaller.Serializer. Any particular reason for the change ?

cyanfish commented 11 months ago

@ashisha690 I don't know if there's a way to change it but the gRPC-generated marshaller doesn't implement Serializer, only ContextualSerializer.

ashisha690 commented 11 months ago

@cyanfish in old versions it seems to be supported. And I didnt find in there release notes if the support of Serializer was deprecated.