From 3d9c1a2739d5aa35bec1d448ca8eb5b87d652bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 15 Apr 2018 17:26:37 +0200 Subject: [PATCH] Cleanup --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2db51fc7..b1dc8b17f 100644 --- a/README.md +++ b/README.md @@ -6340,12 +6340,12 @@ Those guarantees hold as long as you follow three rules: ```swift // SAFE CONCURRENCY - func currentUser(_ db: Database) throws -> User? { + func fetchCurrentUser(_ db: Database) throws -> User? { return try User.fetchOne(db) } // dbQueue is a singleton defined somewhere in your app let user = try dbQueue.read { db in // or dbPool.read - try currentUser(db) + try fetchCurrentUser(db) } // UNSAFE CONCURRENCY @@ -6625,7 +6625,7 @@ DatabaseWriter and DatabaseReader fuel, for example: Reentrant database accesses make it very easy to break the second [safety rule](#guarantees-and-rules), which says: "group related statements within a single call to a DatabaseQueue or DatabasePool database access method.". Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring. - Reentrant methods have been introduced in order to support [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), a set of reactive extensions to GRDB based on [RxSwift](https://github.com/ReactiveX/RxSwift) that need precise scheduling. + There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling. - **`unsafeReentrantWrite`** @@ -6646,7 +6646,7 @@ DatabaseWriter and DatabaseReader fuel, for example: Reentrant database accesses make it very easy to break the second [safety rule](#guarantees-and-rules), which says: "group related statements within a single call to a DatabaseQueue or DatabasePool database access method.". Using a reentrant method is pretty much likely the sign of a wrong application architecture that needs refactoring. - Reentrant methods have been introduced in order to support [RxGRDB](http://github.com/RxSwiftCommunity/RxGRDB), a set of reactive extensions to GRDB based on [RxSwift](https://github.com/ReactiveX/RxSwift) that need precise scheduling. + There is a single valid use case for reentrant methods, which is when you are unable to control database access scheduling. ### Dealing with External Connections