Example #1
0
func Dispatch(q network.Query, comp compiler.Compiler, exec executor.Executor,
	timeout *time.Duration) {
	request := q.Request()
	response := q.Response()

	switch request := request.(type) {
	case network.StringQueryRequest:
		plan, err := comp.Compile(request.QueryString)
		if err != nil {
			response.SendError(err)
			return
		}
		exec.Execute(plan, q, timeout)
	}
}