Skip to content

Scorcher/golang-test1

Repository files navigation

golang-test1

Console 1

go run main.go

Console 2

curl http://127.0.0.1:8080/storage/put/key2/value2 &
curl http://127.0.0.1:8080/storage/put/key1/value1 &
curl http://127.0.0.1:8080/storage/get/key1

output

Put key "key2", value "value2" | Took: 5000 ms | OK
Put key "key1", value "value1" | Took: 8389 ms | OK
Get key "key1" | Took: 0 ms | Value: "value1"

В коде в методе Put намеренно выставлен sleep(5s)

На Get сделал RLock

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages