tree: f98b8087f4b504352bbddf98fb16f0253ce234c3 [path history] [tgz]
  1. go-client/
  2. go-server/
  3. README.md
async/README.md

Use Async Feature

Implement this interface

//AsyncCallbackService callback interface for async
type AsyncCallbackService interface {
	CallBack(response CallbackResponse) // callback
}

like this

type UserProvider struct {
	GetUser func(ctx context.Context, req []interface{}, rsp *User) error
}

func (u *UserProvider) CallBack(res common.CallbackResponse) {
	fmt.Println("CallBack res:",res)
}

Dubbogo will run Async logic once network request finished.