mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-26 21:19:43 +01:00
add channel create call
This commit is contained in:
parent
20693583d9
commit
6ad6a61c33
5 changed files with 36 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ library
|
|||
test-suite test
|
||||
build-depends:
|
||||
base
|
||||
, QuickCheck
|
||||
, QuickCheck
|
||||
, grpc-haskell
|
||||
default-language: Haskell2010
|
||||
ghc-options: -Wall -fwarn-incomplete-patterns -O2 -threaded -rtsopts
|
||||
hs-source-dirs: tests
|
||||
|
|
|
@ -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_completion_queue *completion_queue,
|
||||
const char *method, const char *host,
|
||||
gpr_timespec *deadline);
|
||||
grpc_call *parent_call,
|
||||
uint32_t propagation_mask,
|
||||
grpc_completion_queue *completion_queue,
|
||||
const char *method, const char *host,
|
||||
gpr_timespec *deadline, void *reserved);
|
||||
|
|
|
@ -44,7 +44,7 @@ data ArgValue = ArgString String | ArgInt Int
|
|||
{#pointer *grpc_op as Op newtype #}
|
||||
|
||||
{#fun grpc_init as ^ {} -> `()'#}
|
||||
{#fun grpc_shutdown as ^ {} -> `()'#}
|
||||
{#fun grpc_shutdown as ^ {} -> `()'#}
|
||||
|
||||
{#fun grpc_completion_queue_create as ^ {`Ptr ()'} -> `CompletionQueue'#}
|
||||
|
||||
|
@ -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'} -> `()'#}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue