unclechu's fork of gRPC-haskell
Find a file
Connor Clark d66a4f98b3 Update to gRPC 0.15 (#61)
* update channel arg names, add compression level arg support, add compression level arg test

* switch to temp test demonstrating bug in grpc 0.15.0

* memset op array to 0

* switch examples back

* Switch to newer `grpc` and enable tests in `release.nix`

* Split out `simple-server` test into separate shell script

* Fix bash invocation

* Add intermediate `./default-tests.nix` build

* Add `tests.patch` to version control

* Split `python` command into separate script

* Provide `python` via `nix`
2016-08-05 09:29:20 -07:00
bench remove duplicated threadDelaySecs function (#56) 2016-07-29 13:18:08 -07:00
cbits Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
examples "Hellos" C++/Haskell programs for exercising interop for streaming modes (#49) 2016-07-26 15:21:35 -07:00
include Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
src/Network/GRPC Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
tests Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
.gitignore Criterion benchmarks (#50) 2016-07-26 15:48:25 -07:00
default-tests.nix Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
default.nix Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
grpc-haskell.cabal Connor/metadata improvements (#52) 2016-08-01 12:38:35 -07:00
LICENSE Initial commit. 2015-02-27 18:14:32 +01:00
README.md Update README.md 2016-08-02 14:37:56 -07:00
release.nix Update to gRPC 0.15 (#61) 2016-08-05 09:29:20 -07:00
Setup.hs Initial commit. 2015-02-27 18:14:32 +01:00
stack.yaml Connor/metadata improvements (#52) 2016-08-01 12:38:35 -07:00

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/virtual/env/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.14 version range, so checkout an appropriate revision of the repository, and install as follows:

git clone https://github.com/grpc/grpc.git
git checkout 2b223977c13975648bac2f422363e1ebf83506ce
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    = "2b223977c13975648bac2f422363e1ebf83506ce";
          sha256 = "0arxjdczgj6rbg14f6x24863mrz0xgpakmdfg54zp0xp7h2pghm6";
        };
        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.