mirror of
https://codeberg.org/JasterV/transactions-processor.git
synced 2026-04-26 18:10:06 +00:00
readme update
This commit is contained in:
parent
ee6f48b9b1
commit
5ebb84a070
1 changed files with 37 additions and 9 deletions
46
README.md
46
README.md
|
|
@ -1,16 +1,44 @@
|
|||
# Transactions calculator
|
||||
# Transactions processor
|
||||
|
||||
## Build
|
||||
## Dependencies
|
||||
|
||||
```
|
||||
cargo build [--release]
|
||||
```
|
||||
- **tokio && tokio_stream**: Async runtime that allows us to solve the problem
|
||||
using concurrency and streams
|
||||
- **csv_async**: Thanks to tokio_stream and this library we can read the CSV
|
||||
files using streams instead of writting the entire CSV on memory
|
||||
- **serde**: This library offers an awesome api to easily convert strings to
|
||||
structured data.
|
||||
- **thiserror & anyhow**: I like to use this libraries to handle errors on a
|
||||
cleaner way.
|
||||
- **async-trait**: Since we implement the AsyncActor trait we need to use this
|
||||
library so rust can compile traits using async methods
|
||||
|
||||
## Run
|
||||
## Architecture
|
||||
|
||||
```
|
||||
cargo run
|
||||
```
|
||||
This project is based on the Actor Model.
|
||||
|
||||
- Each actor run on its own thread (tokio tasks in this case)
|
||||
- Actors do not share state
|
||||
- Actors just receive messages and react to it
|
||||
- Each actor has a mailbox (queue) from which it reads the messages in order.
|
||||
|
||||
### TxProcessor actor
|
||||
|
||||
This actor is responsible for processing `Transaction` objects, spawn new
|
||||
Account actors if needed and send messages to them telling to perform any
|
||||
action.
|
||||
|
||||
### Account actor
|
||||
|
||||
This actor is responsible for managing an `Account` object and a map of the
|
||||
transactions done on that account.
|
||||
|
||||
### Why this architecture?
|
||||
|
||||
The Actors model offers a simple, clean and scalable way of building concurrent
|
||||
systems. Because each actor owns its own resources without sharing it to the
|
||||
outside world there is no need to use common concurrent techniques such as Locks
|
||||
and it ensures to not have data races.
|
||||
|
||||
## Author
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue