Coder Social home page Coder Social logo

lodos's People

Contributors

dming avatar

lodos's Issues

就在这里写开发日志好了

今天检查了safemap的问题。
1、明天开始看beego和casbin里的关于go auth的问题,争取两天内完成代码的检查和迁移,把目标代码整合到自己的项目里去。
2、这一步完成以后就进一步检查网关的问题,可以参考那个心动网络的网关要求,封装好网关的接口。
3、这一步也完成以后就把go-redis整合进代码框架里去,让数据储存落地。

。。。后续的计划后续再写

game client MQTT RPC

游戏客户端,我是用C#写的。

从客户端来的MQTT RPC调用,所写的函数的参数第一个需要是session gate.Session,

such as:
m.GetServer().RegisterGo("HD_Test", m.Test)

func (m *Login) Test(session gate.Session, msg string) error {
a := uuid.Rand()
log.Info("Get a test request from mqtt client,\n uuid: %s \n message is %s", a, msg)
return nil
}

git push 失败

遇到一个很奇怪的事情,
项目的origin是https://github.com/dming/lodos的时候

$ git remote -v         
origin	https://github.com/dming/lodos (fetch)
origin	https://github.com/dming/lodos (push)

使用git push,什么反应都没有,不工作,控制台也没有任何反馈

然后找了很多资料都解决不了,最后使用命令:

$ git remote set-url origin [email protected]:dming/lodos
$ git remote -v                                       
origin	[email protected]:dming/lodos (fetch)
origin	[email protected]:dming/lodos (push)

把origin改了以后,就一切都正常了,可以正常git push。

怀疑是ssh的问题,因为在ssh里,ssh [email protected] 是正常的,
但是不知道是不是因为https://github.com这个域名没法解析??

记录下来吧,现在问题暂时解决了。

Go Goroutine 不能从外部杀死

golang的goroutine,或者说go的所有函数,都只能在内部用return结束,不能在外部显式的结束go的函数。

对于一些对时间不敏感的函数,我们需要对其进行设定一个时间,timeout了以后就不管函数进行到哪里,都结束掉这个函数。那么可以参考一下这样的结构体:

func myFunc() (result []reflect.Value, success bool) {
fn := reflect.Value{}
in := make([]reflect.Value, 1)
out_chan := make(chan []reflect.Value)
_func := func() {
out_chan <- fn.Call(in)
}
go _func()

select {
	case _out := <-out_chan:
		return  _out, true
	case <-time.After(time.Second * 2):
		return nil, false
}

}

PS:下面这段代码为原来的函数
func myFunc() (result []reflect.Value, success bool) {
fn := reflect.Value{}
in := make([]reflect.Value, 1)
return fn.Call(in), true
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.