This commit is contained in:
hujiabin 2023-10-25 15:56:24 +08:00
parent 67ec492463
commit dd01c08cca

View File

@ -33,7 +33,6 @@ type httpCliResponse struct {
} }
type httpCliMgr struct { type httpCliMgr struct {
} }
func (this *httpCliMgr) init() { func (this *httpCliMgr) init() {
@ -60,6 +59,28 @@ func (this *httpCliMgr) SendGoStyleRequest(
cb) cb)
} }
func (this *httpCliMgr) SyncSendGoStyleRequest(
url string, params map[string]string,
cb func(HttpCliResponse)) {
chDone := make(chan bool)
this.internalSendRequest(
GO_STYLE_REQUEST,
NORMAL_CHANNEL,
url,
params,
func(rsp HttpCliResponse) {
cb(rsp)
chDone <- true
})
for {
select {
case <-chDone:
close(chDone)
return
}
}
}
func (this *httpCliMgr) SendJsStyleRequest( func (this *httpCliMgr) SendJsStyleRequest(
url string, params map[string]string, url string, params map[string]string,
cb func(HttpCliResponse)) { cb func(HttpCliResponse)) {