redsync/example_test.go

19 lines
267 B
Go

package redsync_test
import "git.bit5.ru/backend/redsync"
func ExampleMutex() {
m, err := redsync.NewMutexWithGenericPool("FlyingSquirrels", pools)
if err != nil {
panic(err)
}
err = m.Lock()
if err != nil {
panic(err)
}
defer m.Unlock()
// Output:
}