Skip to content

Commit

Permalink
Remove old info about persist framework
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Dec 21, 2024
1 parent ec8121c commit 85e17f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Hummingbird.docc/Articles/PersistentData.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ try await persist.remove(key: "mykey")

## Drivers

The `persist` framework defines an API for storing key/value pairs. You also need a driver for the framework. When configuring your application if you want to use `persist` you have to add it to the application and indicate what driver you are going to use. `Hummingbird` comes with a memory based driver ``Hummingbird/MemoryPersistDriver`` which will store these values in the memory of your server.
The `persist` framework defines an API for storing key/value pairs. You also need a driver for the framework. `Hummingbird` comes with a memory based driver ``Hummingbird/MemoryPersistDriver`` which will store these values in the memory of your server.
```swift
let persist = MemoryPersistDriver()
```
If you use the memory based driver the key/value pairs you store will be lost if your server goes down, also you will not be able to share values between server processes.

### Redis

You can use Redis to store the `persists` key/value pairs with ``HummingbirdRedis/RedisPersistDriver`` from the `HummingbirdRedis` library. You would setup `persist` to use Redis as follows. To use the Redis driver you need to have setup Redis with Hummingbird as well.
You can use Redis to store the `persists` key/value pairs with ``HummingbirdRedis/RedisPersistDriver`` from the `HummingbirdRedis` library. You would setup `persist` to use Redis as follows.
```swift
let redis = RedisConnectionPoolService(
.init(hostname: redisHostname, port: 6379),
Expand Down

0 comments on commit 85e17f5

Please sign in to comment.