Skip to content

Commit

Permalink
formatting and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisaaronland committed Jun 19, 2019
1 parent 318c5f2 commit 4230e75
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Listen to a Redis PubSub channel and then rebroadcast it over Server-Sent Events

## Install

You will need to have both `Go` and the `make` programs installed on your computer. Assuming you do just type:
You will need to have both `Go` (specifically version [1.12](https://golang.org/dl/) or higher) and the `make` programs installed on your computer. Assuming you do just type:

```
make bin
make tools
```

All of this package's dependencies are bundled with the code in the `vendor` directory.
Expand Down Expand Up @@ -127,5 +127,6 @@ An actuall living breathing server that will listen to (and relay) a PubSub chan
## See also

* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
* https://github.com/go-redis/redis
* https://github.com/whosonfirst/go-webhookd
* https://github.com/whosonfirst/go-pubsocketd
4 changes: 2 additions & 2 deletions broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (b *Broker) Start(redis_host string, redis_port int, redis_channel string)

pubsub_client := redis_client.PSubscribe(redis_channel)
defer pubsub_client.Close()

// set up the SSE monitor

go func() {
Expand Down Expand Up @@ -90,7 +90,7 @@ func (b *Broker) Start(redis_host string, redis_port int, redis_channel string)

pubsub_client := redis_client.PSubscribe(redis_channel)
defer pubsub_client.Close()

for {

i, _ := pubsub_client.Receive()
Expand Down
5 changes: 3 additions & 2 deletions cmd/pubssed-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ func main() {
mux.HandleFunc(*sse_endpoint, sse_handler)

sse_addr := fmt.Sprintf("%s:%d", *sse_host, *sse_port)
log.Printf("Listening on %s\n", sse_addr)

err = http.ListenAndServe(sse_addr, mux)
err := http.ListenAndServe(sse_addr, mux)

if err != nil {
log.Fatal(err)
err_ch <- err
}

os.Exit(0)
Expand Down

0 comments on commit 4230e75

Please sign in to comment.