tree: 34a9812afd0c1f25dadeb087dcb42ade80cc77b0 [path history] [tgz]
  1. go-client/
  2. go-server/
  3. .travis.yml
  4. 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.