vice

Go channels at horizontal scale (powered by message queues)

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownermatryer/vice
Primary LanguageGo
Program languageGo (Language Count: 2)
Platform
License:Apache License 2.0
所有者活动
Created At2017-07-27 19:20:18
Pushed At2022-07-22 03:09:35
Last Commit At2022-06-13 15:03:34
Release Count4
Last Release Namev2.0.1 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count1.5k
Watchers Count34
Fork Count78
Commits Count122
Has Issues Enabled
Issues Count27
Issue Open Count7
Pull Requests Count28
Pull Requests Open Count2
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private