func (disp *dispatcher) shutdown() {
	select {
	case <-disp.termCh:
	default:
		close(disp.termCh)
	}
}
Private API for Service -----------------------------------------------------
package rpc
import (
	log "github.com/cihub/seelog"
	"io"
)
type dispatcher struct {
	transport Transport
	calls       map[RequestID]*RemoteCall
	streams     map[StreamTag]io.Writer
	progressCbs map[RequestID]func()
	executeCh   chan *executeCmd
	interruptCh chan *interruptCmd
	abandonCh   chan *RemoteCall
	termCh      chan struct{}
	termAckCh   chan struct{}
	taskManager *asyncTaskManager
	idPool      *idPool
	err error
}
func newDispatcher(transport Transport) *dispatcher {
	disp := &dispatcher{
		transport:   transport,
		calls:       make(map[RequestID]*RemoteCall),
		streams:     make(map[StreamTag]io.Writer),
		progressCbs: make(map[RequestID]func()),
		executeCh:   make(chan *executeCmd),
		interruptCh: make(chan *interruptCmd),
		abandonCh:   make(chan *RemoteCall),
		termCh:      make(chan struct{}),
		termAckCh:   make(chan struct{}),
		taskManager: newAsyncTaskManager(),
		idPool:      newIdPool(),
	}
	go disp.loop()
	return disp
}
func (disp *dispatcher) NewRemoteCall(method string, args interface{}) *RemoteCall {
	return newRemoteCall(disp, method, args)
}