history_pagination

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

This example demonstrates a simple chat with manual paginated message recovery from a history stream.

This example does not cover all edge cases (error handling, handling disconnects while recovery in process left as an exercise for a user) - it mostly shows the use of API to iterate over history from client side.

Client subscribes on a channel, on first subscribe we save a channel current stream position to a variable, then on reconnect (which is artificially initiated by a server) we try to restore messages from server history – we do this in chunks calling history method with since and limit filter params.

To start example run the following command from example directory:

go run main.go

Then go to http://localhost:8000 to see it in action.

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