Skip to content

Commit bbad973

Browse files
committed
Update README
1 parent 1432835 commit bbad973

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,31 @@ with out-of-box implementations and great customization possibilities. `Cache` u
3636
## Key features
3737

3838
- [x] Work with Swift 4 `Codable`. Anything conforming to `Codable` will be saved and loaded easily by `Storage`.
39-
- [X] Disk storage by default. Optionally using `memory storage` to enable hybrid.
39+
- [x] Hybrid with memory and disk storage.
4040
- [X] Many options via `DiskConfig` and `MemoryConfig`.
4141
- [x] Support `expiry` and clean up of expired objects.
4242
- [x] Thread safe. Operations can be accessed from any queue.
4343
- [x] Sync by default. Also support Async APIs.
44-
- [X] Store images via `ImageWrapper`.
4544
- [x] Extensive unit test coverage and great documentation.
4645
- [x] iOS, tvOS and macOS support.
4746

4847
## Usage
4948

5049
### Storage
5150

52-
`Cache` is built based on [Chain-of-responsibility pattern](https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern), in which there are many processing objects, each knows how to do 1 task and delegates to the next one. But that's just implementation detail. All you need to know is `Storage`, it saves and loads `Codable` objects.
51+
`Cache` is built based on [Chain-of-responsibility pattern](https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern), in which there are many processing objects, each knows how to do 1 task and delegates to the next one, so can you compose Storages the way you like.
5352

54-
`Storage` has disk storage and an optional memory storage. Memory storage should be less time and memory consuming, while disk storage is used for content that outlives the application life-cycle, see it more like a convenient way to store user information that should persist across application launches.
53+
For now the following Storage are supported
5554

56-
`DiskConfig` is required to set up disk storage. You can optionally pass `MemoryConfig` to use memory as front storage.
55+
- `MemoryStorage`: save object to memory.
56+
- `DiskStorage`: save object to disk.
57+
- `HybridStorage`: save object to memory and disk, so you get persistented object on disk, while fast access with in memory objects.
58+
- `SyncStorage`: blocking APIs, all read and write operations are scheduled in a serial queue, all sync manner.
59+
- `AsyncStorage`: non-blocking APIs, operations are scheduled in an internal queue for serial processing. No read and write should happen at the same time.
60+
61+
Although you can use those Storage at your discretion, you don't have to. Because we also provide a convenient `Storage` which uses `HybridStorage` under the hood, while exposes sync and async APIs through `SyncStorage` and `AsyncStorage`.
62+
63+
All you need to do is to specify the configuration you want with `DiskConfig` and `MemoryConfig`. The default configurations are good to go, but you can customise a lot.
5764

5865

5966
```swift

0 commit comments

Comments
 (0)