A buggy, hacky, distributed publish-subscribe messaging system for websockets written in Go under three weeks.
Go Shell JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
go
js
tests
.gitignore
.groc.json
DESIGN.md
README.md
REG_DOC.md
TODO.md
example.html
twit.html

README.md

Octopi

One octopus, two octopi.

Installation

This package depends on go's unofficial websocket implementation. To install the websockets package, execute the following:

$> go get code.google.com/p/go.net/websocket

Development

  1. Clone the repository

    $> git clone git@github.com:jimjh/octopi.git
  2. Ensure that your $GOPATH contains the go directory in this repository.

    # ~/.bash_profile
    export GOPATH="/path/to/git/repo/go"

Testing

For unit tests, run

$> cd go; make test

For integration tests, run

$> tests/basictests.sh
$> tests/transitiontests.sh

Run

All paths below are relative to the go directory.

To start a broker,

$> go install octopi/run/broker
$> bin/broker -conf config/leader.json

To start a register,

$> go install octopi/run/register
$> bin/register -conf config/register.json

To start followers,

$> go install octopi/run/broker
$> bin/broker -conf config/follower1.json

Note that the leader/follower relationships are only for startup purposes. Once the system is running, all brokers should join as followers. If the leader dies, one of the followers will be elected to become the leader.