Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code-first support #18

Open
netcorefan1 opened this issue Jan 18, 2021 · 5 comments
Open

Code-first support #18

netcorefan1 opened this issue Jan 18, 2021 · 5 comments

Comments

@netcorefan1
Copy link

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
Copy link
Owner

cyanfish commented Jan 20, 2021

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.

@cyanfish cyanfish changed the title This is absolutely a must have! Code-first support Jan 20, 2021
@netcorefan1
Copy link
Author

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
Copy link

@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
Copy link
Owner

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants