add channel create call

This commit is contained in:
Connor Clark 2016-04-20 16:02:53 -07:00
parent 20693583d9
commit 6ad6a61c33
5 changed files with 36 additions and 6 deletions

View file

@ -11,3 +11,14 @@ grpc_event grpc_completion_queue_pluck_(grpc_completion_queue *cq, void *tag,
void *reserved) {
return grpc_completion_queue_pluck(cq, tag, *deadline, reserved);
}
grpc_call *grpc_channel_create_call_(grpc_channel *channel,
grpc_call *parent_call,
uint32_t propagation_mask,
grpc_completion_queue *completion_queue,
const char *method, const char *host,
gpr_timespec *deadline, void *reserved) {
return grpc_channel_create_call(channel, parent_call, propagation_mask,
completion_queue, method, host, *deadline,
reserved);
}

View file

@ -40,6 +40,7 @@ test-suite test
build-depends:
base
, QuickCheck
, grpc-haskell
default-language: Haskell2010
ghc-options: -Wall -fwarn-incomplete-patterns -O2 -threaded -rtsopts
hs-source-dirs: tests

View file

@ -7,6 +7,8 @@ grpc_event *grpc_completion_queue_pluck_(grpc_completion_queue *cq, void *tag,
gpr_timespec *deadline);
grpc_call *grpc_channel_create_call_(grpc_channel *channel,
grpc_call *parent_call,
uint32_t propagation_mask,
grpc_completion_queue *completion_queue,
const char *method, const char *host,
gpr_timespec *deadline);
gpr_timespec *deadline, void *reserved);

View file

@ -54,7 +54,7 @@ data ArgValue = ArgString String | ArgInt Int
{#fun grpc_completion_queue_shutdown as ^ {`CompletionQueue'} -> `()'#}
{#fun grpc_completion_queue_destroy as ^ {`CompletionQueue'} -> `()'#}
{#fun grpc_channel_create_call_ as ^ {`Channel', `CompletionQueue', `String', `String', `CTimeSpecPtr'} -> `Call'#}
{#fun grpc_channel_create_call_ as ^ {`Channel', `Call', `Int', `CompletionQueue', `String', `String', `CTimeSpecPtr', `Ptr ()'} -> `Call'#}
{#fun grpc_insecure_channel_create as ^ {`String', `ChannelArgsPtr', `Ptr ()'} -> `Channel'#}
{#fun grpc_channel_destroy as ^ {`Channel'} -> `()'#}

View file

@ -1,6 +1,7 @@
module Network.GRPC.Core.Constants where
#include "grpc/grpc.h"
#include "grpc/impl/codegen/propagation_bits.h"
argEnableCensus :: Int
argEnableCensus = #const GRPC_ARG_ENABLE_CENSUS
@ -16,3 +17,18 @@ writeBufferHint = #const GRPC_WRITE_BUFFER_HINT
writeNoCompress :: Int
writeNoCompress = #const GRPC_WRITE_NO_COMPRESS
newtype PropagationMask = PropagationMask {unPropagationMask :: Int}
deriving (Show, Eq, Ord)
propagateDeadline :: Int
propagateDeadline = #const GRPC_PROPAGATE_DEADLINE
propagateCensusStatsContext :: Int
propagateCensusStatsContext = #const GRPC_PROPAGATE_CENSUS_STATS_CONTEXT
propagateCensusTracingContext :: Int
propagateCensusTracingContext = #const GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT
propagateCancellation :: Int
propagateCancellation = #const GRPC_PROPAGATE_CANCELLATION