// InvokeAsync mocks base method
495900
func (m *MockLambdaAPI) InvokeAsync(arg0 *lambda.InvokeAsyncInput) (*lambda.InvokeAsyncOutput, error) {
	ret := m.ctrl.Call(m, "InvokeAsync", arg0)
	ret0, _ := ret[0].(*lambda.InvokeAsyncOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
419588
func (r *Router) Invoke(c *Context, next HandlerFunc) {
	h := r.Find(c.Request.Method, c.Request.URL.Path, c)

	if h == nil {
		next(c)
	} else {
		h(c)
	}
}
1313875
func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	var event string // Event entity
	var eventVal int // State of event
	var err error

	if len(args) != 3 && len(args) != 4 {
		return shim.Error("Incorrect number of arguments. Expecting 3 or 4")
	}

	chainCodeToCall := args[0]
	event = args[1]
	eventVal, err = strconv.Atoi(args[2])
	if err != nil {
		return shim.Error("Expected integer value for event state change")
	}
	channelID := ""
	if len(args) == 4 {
		channelID = args[3]
	}

	if eventVal != 1 {
		fmt.Printf("Unexpected event. Doing nothing\n")
		return shim.Success(nil)
	}

	f := "invoke"
	invokeArgs := toChaincodeArgs(f, "a", "b", "10")
	response := stub.InvokeChaincode(chainCodeToCall, invokeArgs, channelID)
	if response.Status != shim.OK {
		errStr := fmt.Sprintf("Failed to invoke chaincode. Got error: %s", string(response.Payload))
		fmt.Printf(errStr)
		return shim.Error(errStr)
	}

	fmt.Printf("Invoke chaincode successful. Got response %s", string(response.Payload))

	// Write the event state back to the ledger
	err = stub.PutState(event, []byte(strconv.Itoa(eventVal)))
	if err != nil {
		return shim.Error(err.Error())
	}

	return response
}
39774
func DeployAsync(d Deployer) Deployer {
	return DeployerFunc(func(ctx context.Context, event events.Deployment, w io.Writer) error {
		go d.Deploy(ctx, event, w)
		return nil
	})
}
582740
func countVMsAsync(c context.Context) error {
	return trigger(c, &tasks.CountVMs{}, datastore.NewQuery(model.ConfigKind))
}
525752
func (client *Client) asyncRequest(ctx context.Context, asyncCommand AsyncCommand) (interface{}, error) {
	var err error

	resp := asyncCommand.AsyncResponse()
	client.AsyncRequestWithContext(
		ctx,
		asyncCommand,
		func(j *AsyncJobResult, e error) bool {
			if e != nil {
				err = e
				return false
			}
			if j.JobStatus != Pending {
				if r := j.Result(resp); r != nil {
					err = r
				}
				return false
			}
			return true
		},
	)
	return resp, err
}
239522
func (worker *DbWorker) invoke(job interface{}) {
	defer func() {
		if err := recover(); err != nil {
			trace := make([]byte, 1024)
			count := runtime.Stack(trace, true)
			moduleLogger.Error("Recover from panic: ", "error", err)
			moduleLogger.Error("Stack", "size", count, "trace", string(trace))
		}
	}()
	// Setup the timeout information
	if worker.TimeoutChannel != nil {
		worker.TimeInfo = &timeoutInfo{worker: worker, started: time.Now(), state: StartJob}
		worker.TimeoutChannel <- worker.TimeInfo
	}
	worker.workInfo.Work(job, worker)
	if worker.TimeoutChannel != nil {
		worker.TimeInfo.state = EndJob
		worker.TimeoutChannel <- worker.TimeInfo
	}
}
147770
func (p *PassthruChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
	function, args := stub.GetFunctionAndParameters()
	return p.iq(stub, function, args)
}
947375
func (c pin) invoke(ch chan<- pin) error {
	for {
		select {
		case <-c.stop:
			return errStopped
		case ch <- c:
			ch = nil
		case err := <-c.response:
			return err
		}
	}
}
1330063
func MakeRequestAsync(request rest.Request) (chan *rest.Response, chan error) {
	r := make(chan *rest.Response)
	e := make(chan error)

	go func() {
		response, err := MakeRequestRetry(request)
		if err != nil {
			e <- err
		}
		if response != nil {
			r <- response
		}
	}()

	return r, e
}
941550
func Invoke(ctx context.Context, method string, args, reply interface{}, conn *Conn) error {
	if ctx == nil {
		ctx = context.Background()
	}

	call := &rpcCall{
		Method: method,
		Args:   args,
		Reply:  reply,
		Error:  make(chan error, 1), // Do not block.
	}

	err := conn.send(ctx, call)
	if err != nil {
		return err
	}

	select {
	case <-ctx.Done():
		return ctx.Err()
	case err = <-call.Error:
		return err
	}
}
1266826
func (c *Client) GetGenerateAsync() FutureGetGenerateResult {
	cmd := btcjson.NewGetGenerateCmd()
	return c.sendCmd(cmd)
}
1367968
func asyncRequest(request *Request, response *Response, c chan int) {
	syncRequest(request, response)
	c <- 1
}
1249361
func (c *Client) GenerateAsync(numBlocks uint32) FutureGenerateResult {
	cmd := btcjson.NewGenerateCmd(numBlocks)
	return c.sendCmd(cmd)
}
871372
func (c *Client) ExecuteAsync(a *Async) error {
	return c.cluster.ExecuteAsync(a)
}
493673
func (app *App) executeInvokes() error {
	// TODO: consider taking a context to limit the time spent running invocations.
	var err error

	for _, fn := range app.invokes {
		fname := fxreflect.FuncName(fn)
		app.logger.Printf("INVOKE\t\t%s", fname)

		if _, ok := fn.(Option); ok {
			err = fmt.Errorf("fx.Option should be passed to fx.New directly, not to fx.Invoke: fx.Invoke received %v", fn)
		} else {
			err = app.container.Invoke(fn)
		}

		if err != nil {
			app.logger.Printf("Error during %q invoke: %v", fname, err)
			break
		}
	}

	return err
}
586356
func (c *Client) VerifyMessageAsync(address btcutil.Address, signature, message string) FutureVerifyMessageResult {
	addr := address.EncodeAddress()
	cmd := btcjson.NewVerifyMessageCmd(addr, signature, message)
	return c.sendCmd(cmd)
}