vice

Go channels at horizontal scale (powered by message queues)

Github星跟踪图

Go channels at horizontal scale Build Status

  • Use Go channels transparently over a messaging queue technology of your choice (Currently NATS, Redis or NSQ, Amazon SQS)
  • Swap vice.Transport to change underlying queueing technologies transparently
  • Write idiomatic Go code instead of learning queue specific APIs
  • Develop against in-memory implementation before putting it into the wild
  • Independent unit tests (no need for running queue technology)

PROJECT STATUS: v1 released

Usage

This code receives names on the , names, queue, and sends greetings on the , greetings,
queue:

// get a Go channel that will receive messages on the
//, names, queue
names := transport.Receive("names")

// get a Go channel that will send messages on the
//, greetings, queue
greetings := transport.Send("greetings")

// respond to, names, messages with, greetings, for name := range names {
	greetings <- []byte("Hello " + string(name))
}
  • The code above is illustrative, be sure to read the design patterns
  • Always stop the Transport, some technologies register and deregister their interest in the queues (this means trapping signals and gracefully shutting down services before exiting)
  • Use Send and Receive methods to get channels, which you can then use as normal
  • Be sure to always handle the ErrChan() error channel to make sure the underlying queue technology is healthy

Quick start guide

  • Write your services with unit tests using normal Go channels (see our design patterns)
  • Install Vice with go get github.com/matryer/vice/...
  • Select a messaging queue technology
  • Build a command to run your service

Read the blog post: Introducing vice: Go channels across many machines

Acknowledgements

Special thanks go to David Hernandez, Jason Hancock and Piotr Rojek for their support on this project.

主要指标

概览
名称与所有者matryer/vice
主编程语言Go
编程语言Go (语言数: 2)
平台
许可证Apache License 2.0
所有者活动
创建于2017-07-27 19:20:18
推送于2022-07-22 03:09:35
最后一次提交2022-06-13 15:03:34
发布数4
最新版本名称v2.0.1 (发布于 )
第一版名称v0.1.0 (发布于 )
用户参与
星数1.5k
关注者数34
派生数78
提交数122
已启用问题?
问题数27
打开的问题数7
拉请求数28
打开的拉请求数2
关闭的拉请求数7
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?