basic

command
v0.1.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

This program is a simplistic example of using Boutique as a state store. This is not a practical example, it just shows how Boutique works.

This example spins up 1000 goroutines that sleep for 1-5 seconds. Our state store simply needs to track how many goroutines are running at a given time and print that number out as the store is updated.

Boutique allows us to subscribe to state changes and we only receive the latest update, not all updates. This again is not a practical example, because we only have 1 subscriber to our changes. This would be easier to accomplish normally with atomic.Value for this counter.

Jump to

Keyboard shortcuts

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