busl

module
v0.0.0-...-2ab7f6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2019 License: MIT

README


busl Build Status Test Coverage

busl - the bustle part of hustle.

a simple pubsub service that runs on Heroku.

Usage

Creating streams

create a stream:

$ export STREAM_ID=$(uuidgen)
$ curl http://localhost:5001/streams/$STREAM_ID -X PUT
# STREAM_ID=b7e586c8404b74e1805f5a9543bc516f
Subscribe

connect a consumer using the stream id:

$ curl http://localhost:5001/streams/$STREAM_ID
...
Disconnections

Subscribers can sometimes get disconnected. If the instance is cycled or deployed for example. When this happens, you can specify a Range header specifying which where your streaming stopped.

$ curl http://localhost:5001/streams/$STREAM_ID -H "Range: bytes=100-"

SSE connections also handle the Last-Event-ID header.

Publish

in a separate terminal, produce some data using the same stream id...

$ curl -H "Transfer-Encoding: chunked" http://localhost:5001/streams/$STREAM_ID -X POST

...and you see the busl.

Setup

to setup to test and run busl, setup dep and then:

$ make setup

Test

to run tests:

$ make test

Run

to run the server:

$ make web

Deploy

Deploy to Heroku

Docker setup

# Start
$ docker-compose start

# Grab the host / port combination chosen by docker
$ export URL=$(docker-compose port web 5000)

# Check health status
$ curl $URL/health
OK

Busltee

The busltee command allows streaming a command's logs to a busl stream.

Building
make busltee

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL