aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2016-02-24 08:36:27 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2016-02-24 08:36:27 -0800
commit65c443ba51bf3327d3c93a6795b98c0db03149a5 (patch)
tree1f39d83cb40be3b56aa74307c410a22dd7dcfb18 /src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
parent5b0fde1a0a2bfa9c2bd39da7285f541a534e65c1 (diff)
parent91edc13bf8a83dd024f9ce4e0ad2246202545a38 (diff)
Merge github.com:grpc/grpc into hide-the-worker
Diffstat (limited to 'src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs')
-rw-r--r--src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
index 59ecebf5a2..cab299a137 100644
--- a/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
+++ b/src/csharp/Grpc.IntegrationTesting/WorkerServiceImpl.cs
@@ -47,6 +47,13 @@ namespace Grpc.Testing
/// </summary>
public class WorkerServiceImpl : WorkerService.IWorkerService
{
+ readonly Action stopRequestHandler;
+
+ public WorkerServiceImpl(Action stopRequestHandler)
+ {
+ this.stopRequestHandler = GrpcPreconditions.CheckNotNull(stopRequestHandler);
+ }
+
public async Task RunServer(IAsyncStreamReader<ServerArgs> requestStream, IServerStreamWriter<ServerStatus> responseStream, ServerCallContext context)
{
GrpcPreconditions.CheckState(await requestStream.MoveNext());
@@ -92,5 +99,16 @@ namespace Grpc.Testing
}
await runner.StopAsync();
}
+
+ public Task<CoreResponse> CoreCount(CoreRequest request, ServerCallContext context)
+ {
+ return Task.FromResult(new CoreResponse { Cores = Environment.ProcessorCount });
+ }
+
+ public Task<Void> QuitWorker(Void request, ServerCallContext context)
+ {
+ stopRequestHandler();
+ return Task.FromResult(new Void());
+ }
}
}