GAM - Go Actor Model gets networking support

agolangf · · 947 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>A while ago, I wrote here about GAM, Go Actor Model, my toy project for learning Go. It has since gained some attention so I&#39;ve added networking support too.</p> <p>The result was pretty nice, we can now pass 600 000+ messages using only two remote actors. While still preserving message order.</p> <p><a href="https://github.com/rogeralsing/gam#be-fast">https://github.com/rogeralsing/gam#be-fast</a></p> <p>To compare with other actor frameworks: JVM Akka does around 5-10 000 messages per sec using Akka.Remote. Akka.NET does less than Akka currently, but around 100 000 messages per sec using the new experimental v 1.5 transport. Project Orleans do more than 100 000+, but AFAIK no message order.</p> <p>Number tossing is of course pointless really, but big numbers are still fun.</p> <p>Would there any interest for a more complete/polished version of this?</p> <hr/>**评论:**<br/><br/>tmornini: <pre><p>I&#39;ll check this out later, starred and followed.</p> <p>Assuming there&#39;s an async mailbox/queue between the actors, I&#39;d love to implement a pluggable system to allow for message brokers in between...</p></pre>rogeralsing: <pre><p>Yes there is, actors can be configured using Props (much like Akka). <a href="https://github.com/rogeralsing/gam/blob/dev/actor/props.go#L40" rel="nofollow">https://github.com/rogeralsing/gam/blob/dev/actor/props.go#L40</a> pid := actor.Spawn(Props(NewMyActor).WithMailbox(MyMailboxProducer)) So it should be fairly easy to create a persistent mailbox</p></pre>tmornini: <pre><p>Nice!</p></pre>rogeralsing: <pre><p>Replacing the mailbox queues for lock free structures increased the remote throughput to 800 000+ :-)</p></pre>rogeralsing: <pre><p>Distributed channels example <a href="https://github.com/rogeralsing/gam/tree/dev/examples/distributedchannels" rel="nofollow">https://github.com/rogeralsing/gam/tree/dev/examples/distributedchannels</a></p></pre>jfurmankiewicz: <pre><p>Looks very promising, I encourage you to make it happen.</p></pre>lastrites17: <pre><p>Continue to be impressed! I really appreciate the idea that all the time I spent learning about the actor model isn&#39;t wasted now that I mostly code in Go.</p></pre>tclineks: <pre><p>while not in the spirit of csp this looks like a pretty interesting project and uses go idioms well.</p></pre>rogeralsing: <pre><p>I&#39;ve added a chat server/client example that shows how to connect multiple clients to a shared server. <a href="https://github.com/rogeralsing/gam/tree/dev/examples/chat" rel="nofollow">https://github.com/rogeralsing/gam/tree/dev/examples/chat</a></p></pre>

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

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