e-chip / redis-rwlock Goto Github PK
View Code? Open in Web Editor NEWGolang implementation of distributed RW-Lock (Writer-preferring) using Redis.
License: MIT License
Golang implementation of distributed RW-Lock (Writer-preferring) using Redis.
License: MIT License
When running go build
in my project, following error is shown:
go: finding github.com/e-chip/redis-rwlock latest
go: downloading github.com/e-chip/redis-rwlock v0.0.0-20191030182710-122e3f7ba621
build xxx: cannot load github.com/e-chip/redis-rwlock/v1: cannot find module providing package github.com/e-chip/redis-rwlock/v1
Failed to run go get
with go module:
$ go get github.com/e-chip/redis-rwlock/v1
go: finding github.com/e-chip/redis-rwlock latest
go: downloading github.com/e-chip/redis-rwlock v0.0.0-20191030182710-122e3f7ba621
go get github.com/e-chip/redis-rwlock/v1: go.mod has post-v0 module path "github.com/e-chip/redis-rwlock/v1" at revision 122e3f7ba621
After reexamine with the go module documentation. There is a statement in the section of Semantic Import Versioning:
If the module is version v0 or v1, do not include the major version in either the module path or the import path.
Furthermore, the semver VCS tag is also required if you would like to support to get specific version by semver. (What happens if I create a go.mod but do not apply semver tags to my repository?)
Currently I use lock in web api to prevent concurrent requests for the same resource. Each resource is given unique GLOB_LOCK_KEY
, READ_LOCK_REF_COUNT
, and WRITER_LOCK_INTENT
keys.
Nevertheless, I found READ_LOCK_REF_COUNT
is not deleted when read unlock, and it is not set TTL. It is only deleted when requesting write lock.
In my case, write lock is necessary but rarely used. It makes redis full of unused READ_LOCK_REF_COUNT
keys.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.