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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?