<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'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's what Erlang'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
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传