File: readme.md

package info (click to toggle)
golang-github-centrifugal-centrifuge 0.15.0%2Bgit20210306.f435ba2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,612 kB
  • sloc: javascript: 102; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
In this example we show how to use `Node.Survey` to collect channel information from all running Centrifuge nodes.

Start Redis server locally:

```
redis-server
```

Start first example instance on port 8000:

```
go run main.go -port 8000
```

Then start another example instance on port 8001 (in another terminal):

```
go run main.go -port 8001
```

Go to http://localhost:8000 and to http://localhost:8001 in another browser tab. Clients will subscribe to channels (each to its `window.location.host`), each second survey will ask for all active channels with number of subscribers from all running nodes.