SOON_ FM | Perceptor
<img src="perceptor.jpg" width="80" height="114" align="right" />
Perceptor is the new SFM_ events system for websocket communication between the Player and API.
This allows the player to connect to the events system without the need for a direct connection
to Redis, meaning the player no longer needs to connect to the VPN to get events.
The ultilate goal will be to remove Redis as the main events hub, moving to REST pushes to various
evented services on demand.
<img src="infrastructor.png" />
Perceptor can be run via Docker. Simply download the image and run:
docker pull registry.soon.build/fm/perceptor docker run --rm -it registry.soon.build/fm/perceptor
Perceptor can be configured via a config file located in any of the following locations:
The config file atleast needs to set client secrets for HMAC request verification:
clients: soundwave: foo shockwave: bar
In addition Redis connection settings and the port
perceptor will run on can also be configured:
# Port to run perceptor on port: 9000 # The log verbosity level (debug, info, wan, error) log_leveL: debug # Redis Host Address redis_host: 127.0.0.1 # Redis Port redis_port: 6379 # Client Secrets - For HMAC Verification clients: soundwave: foo shockwave: bar
You can share this file with the docker container, for example:
docker run --rm -it -v /path/to/perceptor.yml:/etc/perceptor/perceptor.yml registry.soon.build/fm/perceptor
In addition the following environment variables can override configuration:
PERCEPTOR_PORT- The port
PERCEPTOR_LOG_LEVEL- The verbosity of the logging (
PERCEPTOR_REDIS_HOST- Redis Host Address (
PERCEPTOR_REDIS_PORT- Redis Port (
Create a Workspace
Firsrt create a workspace, this will form part of your
mkdir -p ~/Development/Perceptor/src/github.com/thisissoon/FM-Perceptor
Now set your
export GOPATH=~/Development/Perceptor export GO15VENDOREXPERIMENT=1
We have also set
GO15VENDOREXPERIMENT=1 to make use of the
/vendor dirctory support in
Clone the Project
Now you can clone the project into the workspace.
cd ~/Development/Perceptor/src/github.com/thisissoon/FM-Perceptor git clone email@example.com:thisissoon/FM-Perceptor.git .
Now we can get the dependencies using
Now the project can be built:
go build $(glide nv)