diff --git a/common/proxy/proxy.go b/common/proxy/proxy.go index e1133b3fc673ed4e4f2e1c6af86ecb6e6e839ed9..13b95607fbf9521028b40c56a0051c0801186a5a 100644 --- a/common/proxy/proxy.go +++ b/common/proxy/proxy.go @@ -56,7 +56,6 @@ func (p *Proxy) Implement(v interface{}) error { argsInterface[k] = v.Interface() } - //todo:call inv := protocol.NewRPCInvocationForConsumer(methodName, nil, argsInterface, in[2].Interface(), p.callBack, p.attachments, nil) result := p.invoke.Invoke(inv) var err error diff --git a/config/support/reference_config.go b/config/support/reference_config.go index 4e9391e1f761eab89f14c6f6ae84c77684fdaf7f..c23b788bd1631b900d709aec4b10854ab2b68ea7 100644 --- a/config/support/reference_config.go +++ b/config/support/reference_config.go @@ -10,6 +10,7 @@ import ( import ( "github.com/dubbo/dubbo-go/common/extension" + "github.com/dubbo/dubbo-go/common/proxy" "github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/protocol" ) @@ -18,11 +19,13 @@ var refprotocol = extension.GetProtocolExtension("registry") type ReferenceConfig struct { context context.Context + pxy *proxy.Proxy Interface string `required:"true" yaml:"interface" json:"interface,omitempty"` Registries []referenceConfigRegistry `required:"true" yaml:"registries" json:"registries,omitempty"` Cluster string `default:"failover" yaml:"cluster" json:"cluster,omitempty"` Methods []method `yaml:"methods" json:"methods,omitempty"` URLs []config.URL `yaml:"-"` + Async bool `yaml:"async" json:"async,omitempty"` invoker protocol.Invoker } type referenceConfigRegistry struct { @@ -49,7 +52,14 @@ func (refconfig *ReferenceConfig) Refer() { } else { //TODO:multi registries } - //TODO:invoker yincheng 's proxy + //create proxy + attachments := map[string]string{} // todo : attachments is necessary, include keys: ASYNC_KEY銆� + refconfig.pxy = proxy.NewProxy(refconfig.invoker, nil, attachments) +} + +// @v is service provider implemented RPCService +func (refconfig *ReferenceConfig) Implement(v interface{}) error { + return refconfig.pxy.Implement(v) } func (refconfig *ReferenceConfig) loadRegistries() []*config.RegistryURL {