V2EX LT
 LT's recent timeline updates
LT

LT

V2EX member #80489, joined on 2014-11-07 09:38:31 +08:00
LT's recent replies
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
没有阻塞额。。。直接在 go func 外层定义变量, 里层接收值就可以了,
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
@dishonest 看这个 issue 解释 kataras/iris/issues/463 然后,测试下 上一条回复的代码
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
func test(ctx context.Context) {
c := make(chan int)
fmt.Println("start")
go func(){
// 等待 10 秒
time.Sleep(time.Duration(5) * time.Second)
c <- 0
}()
<- c
fmt.Println("end")
ctx.Text("test")
}
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
```
func test(ctx context.Context) {
go func(){
fmt.Println("start")

// 等待 10 秒
time.Sleep(time.Duration(10) * time.Second)

fmt.Println("end")

ctx.Text("test")
}()
}

```
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
time.sleep 是主线程休眠,你要模拟延迟响应应该写盗 go func(){}里面
Jun 20, 2018
Replied to a topic by lauix 程序员 GO 如何实现 页面非阻塞?
其实我更好奇你写出的阻塞代码。每个 http 请求本来就是独立的啊
添加一些 ip 到防火墙后, iptables 的规则里面没有相应 ip, iptables -L 的结果是:
DROP all -- bzq-79-178-9-254.red.bezeqint.net anywhere
DROP all -- cable-24-135-138-230.dynamic.sbb.rs anywhere
DROP all -- 105-226-148-3.east.dsl.telkomsa.net anywhere
DROP all -- host-41.238.20.42.tedata.net anywhere
DROP all -- 188.228.36.184.dynamic.altibox.net anywhere
DROP all -- 91.204.60.100.cn.zp.ua anywhere

这些都是动态 vps 吧?
About     Help     Advertise     Blog     API     FAQ     Solana     984 Online   Highest 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 18ms UTC 19:55 PVG 03:55 LAX 12:55 JFK 15:55
Do have faith in what you're doing.
ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86