]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/go-plugin/grpc_controller.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / go-plugin / grpc_controller.go
1 package plugin
2
3 import (
4 "context"
5
6 "github.com/hashicorp/go-plugin/internal/plugin"
7 )
8
9 // GRPCControllerServer handles shutdown calls to terminate the server when the
10 // plugin client is closed.
11 type grpcControllerServer struct {
12 server *GRPCServer
13 }
14
15 // Shutdown stops the grpc server. It first will attempt a graceful stop, then a
16 // full stop on the server.
17 func (s *grpcControllerServer) Shutdown(ctx context.Context, _ *plugin.Empty) (*plugin.Empty, error) {
18 resp := &plugin.Empty{}
19
20 // TODO: figure out why GracefullStop doesn't work.
21 s.server.Stop()
22 return resp, nil
23 }