akka或golang支持分布式并发的类似替代方案?

I know golang is very good at concurrency with its built-in support, but seems to me they are not distributed, so what would be the framework/library allow us to write producers/consumers applications, in a distributed environment.

If you want to use Go's channel concepts in a distributed program, perhaps check out the Go Circuit framework.

It provides a framework for running multi-process programs (possibly spread over multiple machines), allowing you to use channels to communicate between those processes.

No need to reinvent the wheel here... producer/Consumer applications are usually built using a message queue.

With this approach you should try to break up your problem into small (and ideally idempotent) tasks, build an application which can enqueue these tasks, and then have another worker application which can dequeue these tasks and execute them. Scaling is easy: just add more workers.

There are lots of queuing solutions out there, for a very good one written in Go take a look at NSQ.

Two years late but if anyone else is looking. https://github.com/AsynkronIT/gam

GAM (Go Actor Model) supports both Akka like actors, and Ms Orleans like Virtual Grains. The Ms Orleans like Virtual Grains are supported via Protobuf code generation to give you typed messages and typed grain types. See https://github.com/AsynkronIT/gam/blob/dev/examples/cluster/member/main.go https://github.com/AsynkronIT/gam/blob/dev/examples/cluster/shared/protos.proto

It's also extremely fast, 1 mil+ remote messages per sec.

Just for the record NATS is a high performance solution for distributed systems. It's open source and under MIT license. "The core NATS Server acts as a central nervous system for building distributed applications." and it has official clients for Go, C#, Java, Ruby, Python, Node.js and much more provided by the community.

Akka is based on the Actor Model. For that, there is a nice Go framework I invite you to test : https://github.com/AsynkronIT/protoactor-go

It is said to have great performance since it claims to be passing between nodes:

two million messages per second

While Go is already implementing using CSP, Protoactor adds :

  • Decoupled Concurrency
  • Distributed by default
  • Fault tolerance