Commit graph

30 commits

Author SHA1 Message Date
Connor Clark
4ce7497a33 Fix test failure: remove timeout from runOps, make timeout optional in pluck. (#27) 2016-06-15 10:30:17 -07:00
Connor Clark
1907fa66c4 Server-side call cancellation (#26)
* begin module with LowLevel tests of Op stuff, cancel functions, refactor Ops a little.

* refactor op tests, add server-side cancellation test

* add cancel function for unregistered calls, move some unregistered stuff

* remove unnecessary threadDelay

* update test description

* fix init metadata api for registered server calls

* pass call into handler for cancelling, add cancel test
2016-06-13 13:51:53 -07:00
Connor Clark
58661adf8b Add tests, fix some Valgrind errors (#25)
* add tests for server misbehavior

* fix leaks in pluck and next

* fix deadline leak

* fix slice leak

* always free metadata

* add full TODO in case we get rid of unregistered code

* shorter deadline to make test faster

* update for grpc 0.14.0

* fix another valgrind complaint
2016-06-13 09:25:32 -05:00
Connor Clark
f7e30a1c15 update for grpc 0.14.0 2016-06-09 15:29:21 -07:00
Joel Stanley
8069ebba07 Rename reg operations in all modules; use qualified imports whenever selecting unregistered variants 2016-06-08 15:29:12 -05:00
Joel Stanley
eb1040d07b Rename unreg operations in Network.GRPC.LowLevel.Server.Unregistered 2016-06-08 15:29:12 -05:00
Joel Stanley
2119ef4b16 Group client and server tests together 2016-06-08 15:29:12 -05:00
Joel Stanley
48c9545fdb Low-level tests: more consistent client/server defs and error handling (#22)
* Add field names to NormalRequestResult

* Add concise test definition combs; better error reporting; helpers for metadata comparison
2016-06-08 13:12:07 -05:00
Joel Stanley
d46c0c1c94 Distinguish hostnames vs "host:port" strings; minor echo client cleanup (#20)
* Remove explicit host:port parameter from clientRequest

* Save ClientConfig in Client ADT; derive host:port string as needed

* Add Port newtype and endpoint string constructor fn

* Introduce Endpoint newtype for host:port strings; derive them as needed; misc cleanup

* Clean up echo client
2016-06-06 12:54:43 -05:00
Connor Clark
a757e02c30 fix test 2016-06-03 14:03:57 -07:00
Connor Clark
ce56953b24 Various example/benchmarking code (#16)
* initial echo client/server examples

* registered and unregistered versions of the example client

* ignore pyc files

* cpp echo code, flag to build examples

* threaded server example
2016-06-03 10:34:09 -07:00
Connor Clark
9ffdec4c56 Add ability to send metadata for server registered calls (#15)
* projections from CallDetails

* refactor Call, refactor clientRegisteredRequest, handle null error

* split ServerCall into separate reg/unreg types

* pass method name to unreg call handler, finish destroyServerUnregCall

* function for checking client connection

* test metadata transmission

* send initial metadata for registered calls

* projections from CallDetails

* refactor Call, refactor clientRegisteredRequest, handle null error

* split ServerCall into separate reg/unreg types

* pass method name to unreg call handler, finish destroyServerUnregCall

* function for checking client connection

* test metadata transmission

* send initial metadata for registered calls
2016-06-02 08:55:29 -07:00
Connor Clark
091bf4a457 Improve call-related code (#14)
* projections from CallDetails

* refactor Call, refactor clientRegisteredRequest, handle null error

* split ServerCall into separate reg/unreg types

* pass method name to unreg call handler, finish destroyServerUnregCall
2016-06-02 08:46:20 -07:00
Joel Stanley
378d92efcf Merge branch 'master' into joel/low-level-testing (fixing borked rebase, sorry!) 2016-05-25 17:23:50 -07:00
Joel Stanley
df46b33c6a Fix warnings 2016-05-25 15:43:03 -07:00
Joel Stanley
2882a2a8ff More cleanup: move unsafe payload test to UnsafeTests module, use bracket_ and concurrently 2016-05-25 15:41:37 -07:00
Joel Stanley
e7faab5d3a Fix import after rebase 2016-05-25 14:37:05 -07:00
Joel Stanley
afccc4c8f5 Renames to make use of the unsafe layer more obvious 2016-05-25 14:33:02 -07:00
Joel Stanley
31e4eb7c0a More consistent toplevel value naming (TestTrees, TestClient, TestServer) 2016-05-25 14:33:02 -07:00
Joel Stanley
463000d0bc Add Test{Client,Server} newtype wrappers 2016-05-25 14:33:02 -07:00
Joel Stanley
c9d06c9ec7 Add runClientServer boilerplate reducer 2016-05-25 14:33:02 -07:00
Joel Stanley
562ca8c27c Minor consistency refactors to test case declaration code 2016-05-25 14:33:02 -07:00
Joel Stanley
2262860af1 Make test descriptions more structured and consistent 2016-05-25 14:33:01 -07:00
Joel Stanley
93e9a92328 Relocate preliminary payload tests to LowLevelTests module 2016-05-25 14:33:01 -07:00
Connor Clark
8a0eef8ab7 Fix payload test bugs (#8)
* fix memory mgmt bug in status details strings

* remove flags

* allow server to specify status details
2016-05-25 14:30:57 -07:00
Connor Clark
3746383976 Fix payload test bugs (#8)
* fix memory mgmt bug in status details strings

* remove flags

* allow server to specify status details
2016-05-25 13:11:30 -07:00
Joel Stanley
16208697fa Remove warnings 2016-05-24 14:39:53 -07:00
Joel Stanley
07ed314d24 Relocate preliminary payload tests to LowLevelTests module 2016-05-24 14:34:23 -07:00
Joel Stanley
a5559cfca4 Move unsafe C bindings unit tests to UnsafeTests module; minor nit-linting 2016-05-24 14:27:15 -07:00
Connor Clark
2ad0465df6 Begin safe low-level Haskell layer (#7)
* grpc_server_request_call

* basic slice functionality

* rename function to emphasize side effects

* add docs

* ByteBuffer function bindings

* replace unsafeCoerce with more specific function, add docs, tests.

* add newtypes for Tag and Reserved void pointers

* manually fix request_registered_call binding

* use nocode keyword to fix Ptr () problems

* decouple copying Slice from freeing slice

* Add time ops

* remove nocode decls

* Start Op module, fix c2hs preprocessing order

* metadata manipulation operations

* metadata free function, test

* helper functions for constructing ops of each type

* bindings for op creation functions

* finish up Op creation functions, implement Op destruction, add docs.

* tweak documentation

* rework Op creation functions to work with an array of ops, for ease of use with grpc_call_start_batch

* forgot to change return types

* wrap hook lines, fix types to op creation functions

* implement part of the payload test

* hideous, but working, end to end test

* bindings for connectivity state checks, split test into two threads

* various cleanup

* rename Core to Unsafe for emphasis, clean up tests more

* begin safe low-level facilities

* begin completion queue and server stuff

* Finish server start/stop, cq start/stop, add tests

* facilities for safely executing op batches

* reorganize LowLevel modules, begin explicit export list

* client functionality, stub payload test, various refactors

* tweak cabal file, add test

* add more documentation

* doc tweaks

* begin refactor to improve CompletionQueue safety

* export only thread-safe CQ functions, add registered call creation and other CQ utilities

* begin refactor to use GRPCIO monad, fix missing push semaphore, fix mem leak in server calls

* switch to explicit Either where needed

* add crashing tests, continue fleshing out serverHandleNormalCall

* fix haddock error, finish first draft of request handling function

* reduce GHC warnings

* non-registered client request helpers

* initial request/response test working

* don't pass tags around; generate where needed

* server call bracket functions

* correct order of semaphore acquisition and shutdown check

* simple debug flag logging, simplify Call type

* fix various registered method issues (but still not working)

* cleanup

* delete old code

* remove old todo

* use MetadataMap synonym pervasively

* more comments

* update TODOs

* tweak safety caveat

* docs tweaks

* improve haddocks

* add casts to eliminate clang warnings, remove unused function

* update options to eliminate cabal warnings

* remove outdated todo

* remove unneeded exports from CompletionQueue

* rename to GRPCIOCallError, re-add create/shutdown exports (needed for Server module)

* newtypes for hosts and method names

* more newtypes

* more debug logging

* Fix flag name collision

* instrument uses of free

* more debug

* switch to STM for completion queue stuff

* reduce warnings

* more debugging, create/destroy call tests

* refactor, fix failure cleanup for server call creation. More tests passing.

* formatting tweaks
2016-05-24 13:34:50 -07:00