@@ -18,10 +18,14 @@ object MyService {
18
18
disp => _root_.higherkindness.mu.rpc.internal.service.GRPCServiceDefBuilder.build[F]("io.higherkindness.MyService", (hiMethodDescriptor, _root_.higherkindness.mu.rpc.internal.server.handlers.unary[F, io.higherkindness.Foo, io.higherkindness.Person](algebra.hi, compressionType, disp)))
19
19
}
20
20
def bindService[F[_]](implicit CE: _root_.cats.effect.Async[F], algebra: MyService[F]): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] = _bindService[F](_root_.higherkindness.mu.rpc.protocol.Identity)
21
- def _bindContextService[F[_], Context](compressionType: _root_.higherkindness.mu.rpc.protocol.CompressionType)(implicit CE: _root_.cats.effect.Async[F], serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context], algebra: MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T]): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] = _root_.cats.effect.std.Dispatcher.parallel[F].evalMap {
21
+ def _bindContextService[F[_], Context](compressionType: _root_.higherkindness.mu.rpc.protocol.CompressionType)(implicit CE: _root_.cats.effect.Async[F], serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context], algebra: MyService[({
22
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
23
+ })#T]): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] = _root_.cats.effect.std.Dispatcher.parallel[F].evalMap {
22
24
disp => _root_.higherkindness.mu.rpc.internal.service.GRPCServiceDefBuilder.build[F]("io.higherkindness.MyService", (hiMethodDescriptor, _root_.higherkindness.mu.rpc.internal.server.handlers.contextUnary[F, Context, io.higherkindness.Foo, io.higherkindness.Person](algebra.hi, hiMethodDescriptor, compressionType, disp)))
23
25
}
24
- def bindContextService[F[_], Context](implicit CE: _root_.cats.effect.Async[F], serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context], algebra: MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T]): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] = _bindContextService[F, Context](_root_.higherkindness.mu.rpc.protocol.Identity)
26
+ def bindContextService[F[_], Context](implicit CE: _root_.cats.effect.Async[F], serverContext: _root_.higherkindness.mu.rpc.internal.context.ServerContext[F, Context], algebra: MyService[({
27
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
28
+ })#T]): _root_.cats.effect.Resource[F, _root_.io.grpc.ServerServiceDefinition] = _bindContextService[F, Context](_root_.higherkindness.mu.rpc.protocol.Identity)
25
29
class Client[F[_]](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F]) extends _root_.io.grpc.stub.AbstractStub[Client[F]](channel, options) with MyService[F] {
26
30
override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): Client[F] = new Client[F](channel, options)
27
31
def hi(input: io.higherkindness.Foo): F[io.higherkindness.Person] = _root_.higherkindness.mu.rpc.internal.client.calls.unary[F, io.higherkindness.Foo, io.higherkindness.Person](input, hiMethodDescriptor, channel, options)
@@ -33,15 +37,25 @@ object MyService {
33
37
new Client[F](managedChannelInterpreter, options)
34
38
}
35
39
def unsafeClientFromChannel[F[_]](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F]): MyService[F] = new Client[F](channel, options)
36
- class ContextClient[F[_], Context](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]) extends _root_.io.grpc.stub.AbstractStub[ContextClient[F, Context]](channel, options) with MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T] {
40
+ class ContextClient[F[_], Context](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]) extends _root_.io.grpc.stub.AbstractStub[ContextClient[F, Context]](channel, options) with MyService[({
41
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
42
+ })#T] {
37
43
override def build(channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions): ContextClient[F, Context] = new ContextClient[F, Context](channel, options)
38
44
def hi(input: io.higherkindness.Foo): _root_.cats.data.Kleisli[F, Context, io.higherkindness.Person] = _root_.higherkindness.mu.rpc.internal.client.calls.contextUnary[F, Context, io.higherkindness.Foo, io.higherkindness.Person](input, hiMethodDescriptor, channel, options)
39
45
}
40
- def contextClient[F[_], Context](channelFor: _root_.higherkindness.mu.rpc.ChannelFor, channelConfigList: List[_root_.higherkindness.mu.rpc.channel.ManagedChannelConfig] = List(_root_.higherkindness.mu.rpc.channel.UsePlaintext()), options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): _root_.cats.effect.Resource[F, MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T]] = _root_.cats.effect.Resource.make(new _root_.higherkindness.mu.rpc.channel.ManagedChannelInterpreter[F](channelFor, channelConfigList).build)(channel => CE.void(CE.delay(channel.shutdown()))).evalMap(ch => CE.delay(new ContextClient[F, Context](ch, options)))
41
- def contextClientFromChannel[F[_], Context](channel: F[_root_.io.grpc.ManagedChannel], options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): _root_.cats.effect.Resource[F, MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T]] = _root_.cats.effect.Resource.make(channel)(channel => CE.void(CE.delay(channel.shutdown()))).evalMap(ch => CE.delay(new ContextClient[F, Context](ch, options)))
42
- def unsafeContextClient[F[_], Context](channelFor: _root_.higherkindness.mu.rpc.ChannelFor, channelConfigList: List[_root_.higherkindness.mu.rpc.channel.ManagedChannelConfig] = List(_root_.higherkindness.mu.rpc.channel.UsePlaintext()), disp: _root_.cats.effect.std.Dispatcher[F], options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T] = {
46
+ def contextClient[F[_], Context](channelFor: _root_.higherkindness.mu.rpc.ChannelFor, channelConfigList: List[_root_.higherkindness.mu.rpc.channel.ManagedChannelConfig] = List(_root_.higherkindness.mu.rpc.channel.UsePlaintext()), options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): _root_.cats.effect.Resource[F, MyService[({
47
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
48
+ })#T]] = _root_.cats.effect.Resource.make(new _root_.higherkindness.mu.rpc.channel.ManagedChannelInterpreter[F](channelFor, channelConfigList).build)(channel => CE.void(CE.delay(channel.shutdown()))).evalMap(ch => CE.delay(new ContextClient[F, Context](ch, options)))
49
+ def contextClientFromChannel[F[_], Context](channel: F[_root_.io.grpc.ManagedChannel], options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): _root_.cats.effect.Resource[F, MyService[({
50
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
51
+ })#T]] = _root_.cats.effect.Resource.make(channel)(channel => CE.void(CE.delay(channel.shutdown()))).evalMap(ch => CE.delay(new ContextClient[F, Context](ch, options)))
52
+ def unsafeContextClient[F[_], Context](channelFor: _root_.higherkindness.mu.rpc.ChannelFor, channelConfigList: List[_root_.higherkindness.mu.rpc.channel.ManagedChannelConfig] = List(_root_.higherkindness.mu.rpc.channel.UsePlaintext()), disp: _root_.cats.effect.std.Dispatcher[F], options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): MyService[({
53
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
54
+ })#T] = {
43
55
val managedChannelInterpreter = new _root_.higherkindness.mu.rpc.channel.ManagedChannelInterpreter[F](channelFor, channelConfigList).unsafeBuild(disp)
44
56
new ContextClient[F, Context](managedChannelInterpreter, options)
45
57
}
46
- def unsafeContextClientFromChannel[F[_], Context](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): MyService[({ type T[α] = _root_.cats.data.Kleisli[F, Context, α] })#T] = new ContextClient[F, Context](channel, options)
58
+ def unsafeContextClientFromChannel[F[_], Context](channel: _root_.io.grpc.Channel, options: _root_.io.grpc.CallOptions = _root_.io.grpc.CallOptions.DEFAULT)(implicit CE: _root_.cats.effect.Async[F], clientContext: _root_.higherkindness.mu.rpc.internal.context.ClientContext[F, Context]): MyService[({
59
+ type T[α] = _root_.cats.data.Kleisli[F, Context, α]
60
+ })#T] = new ContextClient[F, Context](channel, options)
47
61
}
0 commit comments