func()

in gdbclient/gdbclient.go [232:261]


func (c *baseClient) requestAsync(request *graphsonv3.Request) (*graphsonv3.ResponseFuture, error) {
	conn, err := c.connPool.Get()
	if err != nil {
		internal.Logger.Error("request connect failed",
			zap.Time("time", time.Now()),
			zap.Error(err))
		return nil, err
	}

	bindingsStr, _ := json.Marshal(request.Args[graph.ARGS_BINDINGS])
	// send request to connection, and return future
	internal.Logger.Info("submit script",
		zap.Time("time", time.Now()),
		zap.Uintptr("conn", uintptr(unsafe.Pointer(conn))),
		zap.String("dsl", request.Args[graph.ARGS_GREMLIN].(string)),
		zap.String("bindings", string(bindingsStr)),
		zap.String("processor", request.Processor))

	f, err := conn.SubmitRequestAsync(request)
	if err != nil {
		// return connection to pool if request is not pending
		c.connPool.Put(conn)
		internal.Logger.Warn("submit script failed",
			zap.Time("time", time.Now()),
			zap.Uintptr("conn", uintptr(unsafe.Pointer(conn))),
			zap.Error(err),
			zap.String("dsl", request.Args[graph.ARGS_GREMLIN].(string)))
	}
	return f, err
}