unclechu's fork of gRPC-haskell
Go to file
Joel Stanley b78b15ecdb Fix author/maintainer/copyright in grpc-haskell.cabal (#82)
Update LICENSE, update fields in grpc-haskell.cabal
2016-12-14 12:55:56 -06:00
bench fix up benchmarks to run with latest changes (#72) 2016-08-26 10:21:59 -07:00
cbits Connor/security (#68) 2016-08-17 09:55:06 -07:00
examples Connor/security (#68) 2016-08-17 09:55:06 -07:00
include Connor/security (#68) 2016-08-17 09:55:06 -07:00
nix Fix `grpc-haskell` tests for Nix (#80) 2016-12-12 10:40:23 -08:00
src/Network/GRPC MONAPP-1369: Server options for generated code. (#76) 2016-11-30 14:22:47 -08:00
tests Fix `grpc-haskell` tests for Nix (#80) 2016-12-12 10:40:23 -08:00
.gitignore Criterion benchmarks (#50) 2016-07-26 15:48:25 -07:00
LICENSE Fix author/maintainer/copyright in grpc-haskell.cabal (#82) 2016-12-14 12:55:56 -06:00
README.md Update README.md 2016-08-15 17:24:00 -07:00
Setup.hs Initial commit. 2015-02-27 18:14:32 +01:00
default.nix Fix `grpc-haskell` tests for Nix (#80) 2016-12-12 10:40:23 -08:00
grpc-haskell.cabal Fix author/maintainer/copyright in grpc-haskell.cabal (#82) 2016-12-14 12:55:56 -06:00
release.nix Add DYLD_LIBRARY_PATH to executable environments during postInstall (#81) 2016-12-12 15:45:58 -06:00
stack.yaml fix broken test, fix stack.yaml (#78) 2016-12-08 10:10:32 -08:00

README.md

Running the tests

In order to run the tests, you will need to have the grpcio, gevent, and grpcio-tools python packages installed. You can install them using pip. It is recommended that you use a python virtualenv to do this.

$ virtualenv path/to/virtualenv # to create a virtualenv
$ . path/to/virtualenv/bin/activate # to use an existing virtualenv
$ pip install grpcio-tools gevent
$ pip install grpcio # Need to install grpcio-tools first to avoid a versioning problem

Building GRPC

In order to compile this project, and anything which depends on it, you will need a working installation of the GRPC C core libraries. This library currently uses the 0.15 version range. If you are on OS X, you can install it with homebrew:

brew tap grpc/grpc
brew install grpc

Alternatively, you can build gRPC from source by checking out an appropriate revision of the repository, and installing as follows:

git clone https://github.com/grpc/grpc.git
git checkout release-0_15_1
cd grpc
git submodule update --init
make
sudo make install

Alternatively, using Nix, pass the following expression to nix-build and point Stack to the build products in the Nix store:

let pkgs = import <nixpkgs> {};
in  pkgs.stdenv.mkDerivation rec
    {   name = "grpc";
        src = pkgs.fetchgit
        { url    = "https://github.com/grpc/grpc.git";
          rev    = "674b30373e2d6a1e26425952805179f8d52a8c00";
          sha256 = "05vj48w4h7bn6xyf1wyg2l6psl38h4yz6j1cl0yd2p5h7f5hb3s7";
        };
        preInstall = "export prefix";
        buildInputs =
        [   pkgs.darwin.cctools
            pkgs.autoconf
            pkgs.automake
            pkgs.libtool
            pkgs.which
            pkgs.zlib

            pkgs.openssl
        ];
    }

Using the Library

You must compile with -threaded, because we rely on being able to execute Haskell while blocking on foreign calls to the gRPC library. If not using code generation, the recommended place to start is in the Network.GRPC.HighLevel.Server.Unregistered module, where serverLoop provides a handler loop.