Wait for requests to finish before closing transport

This commit is contained in:
Asim Aslam
2017-05-31 19:21:41 +01:00
parent ce37d7fbe8
commit 726793b6fa
2 changed files with 28 additions and 0 deletions

View File

@@ -6,6 +6,14 @@ import (
type serverKey struct{}
func wait(ctx context.Context) bool {
if ctx == nil {
return false
}
wait, _ := ctx.Value("wait").(bool)
return wait
}
func FromContext(ctx context.Context) (Server, bool) {
c, ok := ctx.Value(serverKey{}).(Server)
return c, ok