add inmemory tutorial

This commit is contained in:
InsanusMokrassar 2024-05-04 22:28:25 +06:00
parent 68426c126d
commit 4dd90738ba
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# In memory
In memory realizations contains several simple variants:
* [MapCRUDRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-c-r-u-d-repo/index.html)
* [MapKeyValueRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-key-value-repo/index.html)
* [MapKeyValuesRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-key-values-repo/index.html)
Each realization contains `Write` and `Read` parents.
There are several important moments:
## [WriteMapCRUDRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-write-map-c-r-u-d-repo/index.html) (and [MapCRUDRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-c-r-u-d-repo/index.html))
It is an abstract repo with abstract functions: `updateObject` and `createObject`. Both functions require from realization to create `Registered` variant from incoming data and
both will be called within repo [locker.withWriteLock](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.coroutines/with-write-lock.html).
You may use functions [MapCRUDRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-c-r-u-d-repo.html) with
passing the callbacks `updateObject` and `createObject` which will be used in their realizations of default [MapCRUDRepo](https://microutils.inmo.dev/micro_utils.dokka/dev.inmo.micro_utils.repos/-map-c-r-u-d-repo/index.html)
variant

View File

@ -12,7 +12,9 @@ nav:
- 'micro_utils/index.md'
- 'micro_utils/resources.md'
- 'micro_utils/startup.md'
- 'micro_utils/repos/'
- 'Repos':
- 'micro_utils/repos/index.md'
- 'micro_utils/repos/inmemory.md'
- 'Telegram Bot API':
- 'tgbotapi/index.md'
- KDocs: 'https://tgbotapi.inmo.dev'