func (w WaitCtx) ChSucceed() chan struct{} {
	return w.Value("succeed").(chan struct{})
}
ChSucceed delivers the message that the context's been finished successfully
package main
import (
	"bufio"
	"encoding/json"
	"fmt"
	"io"
	"net"
	"os"
	"time"
	"golang.org/x/net/context"
	"github.com/Sirupsen/logrus"
	"github.com/docker/docker/api/types"
	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/api/types/network"
	dcli "github.com/docker/docker/client"
	"github.com/docker/docker/pkg/stdcopy"
	"github.com/garyburd/redigo/redis"
)
var DockerClient *dcli.Client
const DockerAPIVersion = "1.24"
type Runner struct {
	Lang          string `json:"lang"`
	Source        string `json:"source"`
	Version       string `json:"version"`
	Timeout       int    `json:"timeout"`  
	closeNotifier <-chan bool
	logger        *logrus.Logger
	containerID   string
}
var Runnerthrottle chan struct{}
type WaitCtx struct {
	context.Context
	Cancel context.CancelFunc
}
func newWaitCtx(r *Runner) WaitCtx {
	ctx := context.WithValue(context.Background(), "close", r.closeNotifier)
	ctx = context.WithValue(ctx, "succeed", make(chan struct{}))
	wctx := WaitCtx{}
	wctx.Context, wctx.Cancel = context.WithTimeout(ctx, time.Duration(r.Timeout)*time.Second)
	return wctx
}