user_subscribe_unsubscribe

command
v0.0.0-...-984fa5a Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 11 Imported by: 0

README

In this example we show how Node.Subscribe and Node.Unsubscribe can be used to control server-side subscriptions of a user.

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.

On start user will be subscribed on server-side to a channel blink182. After you click on a screen Centrifuge client will issue an RPC call to a server, a server will then unsubscribe user, then subscribe it back (after 1-second delay). Both browser tabs should receive subscribe/unsubscribe events.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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