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

Separate gRPC #18

Closed
Rurouni opened this issue Mar 14, 2017 · 17 comments
Closed

Separate gRPC #18

Rurouni opened this issue Mar 14, 2017 · 17 comments

Comments

@Rurouni
Copy link

Rurouni commented Mar 14, 2017

Hi,
I was wondering if you can separate "gRPC for unity" part from MagicOnion as standalone github project. There is definitely a need for strong client side gRPC library for unity and yours is the only one that I've found.
I was planning to use only gRPC part so if it was standalone I would be able to contribute pull requests with potential bugfixes or help with upgrading to 1.1 etc
In any way thank you for lots of great high quality libraries around unity and dotnet core 👍

@neuecc
Copy link
Member

neuecc commented Mar 17, 2017

You're right.
I think that the gRPC project should be separeted, too.
However, MagicOnion is not stable and Unity requires library under specify foloder so importing by SubModule makes difficult to development.

I'm sorry, please use it gRPC client from MagicOnion, now.
But, I'll remove reference of MagicOnion from gRPC Client.

@Rurouni
Copy link
Author

Rurouni commented Mar 17, 2017

I totaly get you with submodules they are huge pain. One option I found for me that works much better than git submodules is git subtree http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/
It feels like you have single repo but you can still quite easy pull/push merges from other repo

@neuecc
Copy link
Member

neuecc commented Mar 17, 2017

Our company was using Subtree for another project for a while,
but it stopped because there are many troubles.
A non-natural workflow brought about a lot of confusion.

@Rurouni
Copy link
Author

Rurouni commented Mar 17, 2017

I see, yes it does require deep understanding of what git is and that is rare for many developers in gamedev industry.
Main reason for me to use just gRPC bit is as you said MagicOnion is in alpha state. So I am using directly DefaultCallInvoker with Method<byte[], byte[]> . In the long run it would make much more sense to use whole MagicOnion because gRPC without typed client generation is not really gRPC but just an http/2 library and thats what MagicOnion brings ultimately - statically typed clients

P.S The only place that leaks MagicOnion into gRPC is in RpcException atm

@aerykk
Copy link

aerykk commented Mar 30, 2017

Def interested in this as well. Going to be playing around with MagicOnion later and specifically looking at the gRPC aspect. Also going to see what it would take to transform the generated client code into something IL2CPP conforming (maybe a script that runs it through some regex to fix it up - like a codemod).

@chenditc
Copy link

I would like to get a Unity-grpc plugin work too. Could you provide us more info about your work, like how you compile .a file for iOS, then we can all contribute to this.

@bwplotka
Copy link

+1 for separation of just gRPC client code. Cannot see any alternative for doing gRPC/HTTP2 in Unity (Especially when I need to stick to 4.x for now) 😨

Anyone was actually able to successfully perform some gRPC unary/server-side streaming call from unity using this package against properly "protobuf-generated" gRPC server? Could you guys show some example code, on how to do it? Not much details on that in this repo (: @Rurouni seems you were able to do it.

Thanks in advance, and especially @neuecc for bringing this.

@Rurouni
Copy link
Author

Rurouni commented Sep 11, 2017

@Bplotka I don't think it will work agains proto generated gRPC server, but you can use it with ServerServiceDefinition and manually adding methods with whatever serialisation and building server (check what code grpc proto plugin does generate). To make stuff easier I am using single bidirectional streaming method with byte[]->byte[] signature and doing my own protobuf serialisation and dispatch into some handler.

@bwplotka
Copy link

So actually I managed to set it up against proto generated gRPC server with complex protobufs in requests and response.. 👍 Both unary and server streaming. I can explain how I did this briefly later.

@hubbaba
Copy link

hubbaba commented Sep 29, 2017

@Bplotka, I'm starting to look at using this to connect Unity to a gRPC server with proto request and responses already defined. It seems you are 18 days ahead of me. :) Any advice on setting it up before I dive in?

@bwplotka
Copy link

bwplotka commented Sep 29, 2017

@hubbaba Sure, what OS you want to run Unity on? I managed to get Unity working as a gRPC client on Windows (I have gRPC microservices on Linux in separate cloud). I can put more details during weekend.

@hubbaba
Copy link

hubbaba commented Sep 29, 2017

@Bplotka Thanks! and no rush. I really appreciate the help and I'll bet other people do as well. Windows works for me. The server is on linux (nodejs).

@bwplotka
Copy link

bwplotka commented Oct 5, 2017

@hubbaba, All: I have created this repo https://github.com/Bplotka/unity-grpc with separated gRPC library, Tutorial and examples, to cover all the steps and problems I ran into while chasing Unity + gRPC.

Hope it will be helpful for all of you guys (: Let me know if you have any more questions.

Thanks @neuecc for the gRPC lib, I think it unblocked us all...!

@pitaslayer
Copy link

@Bplotka Thank you for the gRPC library stand-alone! However I'm having some problems with manual code creation. Can you provide me assistance on that matter?

P.S. - I explained in more detail my problem in the standalone repository.

@bwplotka
Copy link

bwplotka commented Oct 6, 2017

I responded to your question in the bwplotka/unity-grpc#1

@hubbaba
Copy link

hubbaba commented Oct 7, 2017

Thanks @Bplotka !! I'll check it out this weekend and let you know how it goes. Thank you so much!

@neuecc
Copy link
Member

neuecc commented Jan 7, 2019

Currently gRPC supports Unity and build binary is officialy released(beta).
https://packages.grpc.io/
MagicOnion2 uses it.

@neuecc neuecc closed this as completed Jan 7, 2019
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

7 participants