Is there demirits to run multiple go server together with goroutine?

agolangf · · 551 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>The thing is i need to run multiple server that all communicates with one an other and to keep things small i want to run all the servers together, and run them via goroutine. Is there any problem with this setup?</p> <hr/>**评论:**<br/><br/>SocalNick: <pre><p>Not sure how common it is, but several components of Diego, the Cloud Foundry backend, do something similar. One of the contributors made a library to support it:</p> <p><a href="https://github.com/tedsuo/ifrit" rel="nofollow">https://github.com/tedsuo/ifrit</a> </p> <p>I don&#39;t have a simple example offhand, but this is how it is used:</p> <p><a href="https://github.com/cloudfoundry-incubator/rep/blob/master/cmd/rep/main.go#L319" rel="nofollow">https://github.com/cloudfoundry-incubator/rep/blob/master/cmd/rep/main.go#L319</a></p></pre>Manbeardo: <pre><p>Seems like a sound approach to me. Just be extra careful that nothing panics out because an unrecovered panic in any of your goroutines will bring down the entire process.</p></pre>DarkRye: <pre><p>I have a go server that provides top and udp endpoint s. It works well. </p></pre>dericofilho: <pre><p>That&#39;s what Erlang&#39;s BEAM would do. You can actually supervise them. Take a look at this... </p> <p><a href="https://github.com/thejerf/suture" rel="nofollow">https://github.com/thejerf/suture</a></p></pre>sadlil: <pre><p>What if i implent grpc servers with goroutine? grpc servers uses http2. or what about using tcp, http servers together..??</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

551 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传