修复woker 通信bug
This commit is contained in:
parent
f28acb2f29
commit
a28f4a5396
@ -69,7 +69,7 @@ func (this *RPCX) UnregisterAll() (err error) {
|
|||||||
func (this *RPCX) Call(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCX) Call(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
//先排查下 服务端是否存在连接对象 不存在 在使用客户端对象连接
|
//先排查下 服务端是否存在连接对象 不存在 在使用客户端对象连接
|
||||||
err = this.service.Call(ctx, servicePath, serviceMethod, args, reply)
|
err = this.service.Call(ctx, servicePath, serviceMethod, args, reply)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.Call(ctx, servicePath, serviceMethod, args, reply)
|
return this.client.Call(ctx, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -78,7 +78,7 @@ func (this *RPCX) Call(ctx context.Context, servicePath string, serviceMethod st
|
|||||||
//广播调用
|
//广播调用
|
||||||
func (this *RPCX) Broadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCX) Broadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
err = this.service.Broadcast(ctx, servicePath, serviceMethod, args, reply)
|
err = this.service.Broadcast(ctx, servicePath, serviceMethod, args, reply)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.Broadcast(ctx, servicePath, serviceMethod, args, reply)
|
return this.client.Broadcast(ctx, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -87,7 +87,7 @@ func (this *RPCX) Broadcast(ctx context.Context, servicePath string, serviceMeth
|
|||||||
//异步调用
|
//异步调用
|
||||||
func (this *RPCX) Go(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) {
|
func (this *RPCX) Go(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) {
|
||||||
call, err = this.service.Go(ctx, servicePath, serviceMethod, args, reply, done)
|
call, err = this.service.Go(ctx, servicePath, serviceMethod, args, reply, done)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.Go(ctx, servicePath, serviceMethod, args, reply, done)
|
return this.client.Go(ctx, servicePath, serviceMethod, args, reply, done)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -96,7 +96,7 @@ func (this *RPCX) Go(ctx context.Context, servicePath string, serviceMethod stri
|
|||||||
//跨服同步调用
|
//跨服同步调用
|
||||||
func (this *RPCX) AcrossClusterCall(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCX) AcrossClusterCall(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
err = this.service.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
err = this.service.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
return this.client.AcrossClusterCall(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -105,7 +105,7 @@ func (this *RPCX) AcrossClusterCall(ctx context.Context, clusterTag string, serv
|
|||||||
//跨集群 广播
|
//跨集群 广播
|
||||||
func (this *RPCX) AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCX) AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
err = this.service.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
err = this.service.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
return this.client.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -114,7 +114,7 @@ func (this *RPCX) AcrossClusterBroadcast(ctx context.Context, clusterTag string,
|
|||||||
//跨服异步调用
|
//跨服异步调用
|
||||||
func (this *RPCX) AcrossClusterGo(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) {
|
func (this *RPCX) AcrossClusterGo(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (call *client.Call, err error) {
|
||||||
call, err = this.service.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
call, err = this.service.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
return this.client.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -124,7 +124,7 @@ func (this *RPCX) AcrossClusterGo(ctx context.Context, clusterTag string, servic
|
|||||||
func (this *RPCX) ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCX) ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
|
|
||||||
err = this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
err = this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
||||||
if strings.Contains(err.Error(), "on found") {
|
if err != nil && strings.Contains(err.Error(), "on found") {
|
||||||
return this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
return this.client.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user