From 7a1ec99729629666f84a6ac4be24355e8799a16c Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期五, 02 四月 2021 11:10:32 +0800
Subject: [PATCH] rename
---
requestTopic.go | 4 ++--
micronode.go | 4 ++--
hbusc.go | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hbusc.go b/hbusc.go
index 725aecf..0735c04 100644
--- a/hbusc.go
+++ b/hbusc.go
@@ -86,7 +86,7 @@
}
}
-//func recvandsendRoutine(ctx context.Context, s *bhomebus.Socket, wg *sync.WaitGroup,serveFn func(rdata []byte, rkey int, sdata *[]byte) bool, logFn func(...interface{})) {
+//func recvandsendRoutine(h context.WrapperHandler, s *bhomebus.Socket, wg *sync.WaitGroup,serveFn func(rdata []byte, rkey int, sdata *[]byte) bool, logFn func(...interface{})) {
// for {
// select {
// case <-ctx.Done():
diff --git a/micronode.go b/micronode.go
index b7acf0d..89e4088 100644
--- a/micronode.go
+++ b/micronode.go
@@ -298,11 +298,11 @@
if f,ok := ms.handlers[reqBody.Path];ok {
reqBody.SrcProc = msgR.SrcProc
- ctx := Context{
+ h := WrapperHandler{
ms,
ms,
}
- ri = f(&ctx, &reqBody)
+ ri = f(&h, &reqBody)
ms.printLog("call funcMap f,reply.Success:", ri.Success)
} else {
ms.printLog("ms.funcMap not eixst path: ", reqBody.Path)
diff --git a/requestTopic.go b/requestTopic.go
index f648a92..2ee903a 100644
--- a/requestTopic.go
+++ b/requestTopic.go
@@ -1,11 +1,11 @@
package bhomeclient
-type Context struct {
+type WrapperHandler struct {
Bk Broker
Tr Transport
}
-type MicroFunc func(ctx *Context, req *Request) *Reply
+type MicroFunc func(h *WrapperHandler, req *Request) *Reply
type Transport interface {
--
Gitblit v1.8.0