Skip to content

Commit

Permalink
Usage demo in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaldekloe committed Oct 4, 2019
1 parent ef4c159 commit 8fbb7b5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ This is free and unencumbered software released into the
[public domain](https://creativecommons.org/publicdomain/zero/1.0).


## Use

```go
// Redis is a thread-safe client.
var Redis = redis.NewClient("localhost", time.Second, timeSecond)

func demo() {
newLen, err := Redis.RPUSHString("demo_list", "foo")
if err != nil {
return err // complete description in place
}
log.Printf("demo_list has %d elements now", newLen)
}
```


## Performance

A local Unix domain socket connection is roughly twice as fast than TCP.
Expand Down

0 comments on commit 8fbb7b5

Please sign in to comment.