Skip to content

Instantly share code, notes, and snippets.

@kolmodin
Created March 23, 2015 21:10
Show Gist options
  • Save kolmodin/8d1de957ccf574f4c5c3 to your computer and use it in GitHub Desktop.
Save kolmodin/8d1de957ccf574f4c5c3 to your computer and use it in GitHub Desktop.
gRPC in Haskell
hello = SayHello "/helloworld.Greeter/SayHello" . HelloRequest
main :: IO ()
main = do
c_grpc_init
channel <- channelCreate "localhost:50051" (ChannelArgs nullPtr)
context <- newClientContext channel
invokeCall context (hello "Haskell") >>= print
channelDestroy channel
c_grpc_shutdown
$ dist/build/helloworldclient/helloworldclient
RpcOk (HelloReply "\n\rHello Haskell")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment