Closed threema-donat closed 2 months ago
Curious: why not use tokio's RwLock
which also does not return Result
? Looks like some functions are not currently async
but perhaps they could be made such.
Curious: why not use tokio's
RwLock
which also does not returnResult
? Looks like some functions are not currentlyasync
but perhaps they could be made such.
The maintainers of tokio itself say that one should not use the async version of Mutex / RwLock without having reason for that: link. The same can very likely also be said about RwLock.
For this reason, I think it's better to use parking_lot.
Please resolve conflicts :)
Description
The current version does panic if a RwLock is poisoned and also when a HTTP request could not be constructed from the given user data.
This PR replaces the RwLocks with the ones from parking_lot that do not have poison errors and adds propagation of errors happening when building the http request.
Resolves #69
How Has This Been Tested?
A test has been written for the invalid payload.
Due Dilligence