Skip to content

Commit

Permalink
[ios] Set separate dispatch queues for firestore and database
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbianca committed May 15, 2018
1 parent 54f4156 commit fa9bac1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
11 changes: 5 additions & 6 deletions ios/RNFirebase/database/RNFirebaseDatabase.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@
@implementation RNFirebaseDatabase
RCT_EXPORT_MODULE();

// TODO document methods
// Run on a different thread
- (dispatch_queue_t)methodQueue {
return dispatch_queue_create("io.invertase.react-native-firebase.database", DISPATCH_QUEUE_SERIAL);
}

- (id)init {
self = [super init];
if (self != nil) {
_dbReferences = [[NSMutableDictionary alloc] init];
_transactions = [[NSMutableDictionary alloc] init];
_transactionQueue = dispatch_queue_create("io.invertase.react-native-firebase", DISPATCH_QUEUE_CONCURRENT);
_transactionQueue = dispatch_queue_create("io.invertase.react-native-firebase.database.transactions", DISPATCH_QUEUE_CONCURRENT);
}
return self;
}
Expand Down Expand Up @@ -446,7 +449,3 @@ + (BOOL)requiresMainQueueSetup {
@implementation RNFirebaseDatabase
@end
#endif




7 changes: 6 additions & 1 deletion ios/RNFirebase/firestore/RNFirebaseFirestore.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
@implementation RNFirebaseFirestore
RCT_EXPORT_MODULE();

// Run on a different thread
- (dispatch_queue_t)methodQueue {
return dispatch_queue_create("io.invertase.react-native-firebase.firestore", DISPATCH_QUEUE_SERIAL);
}

- (id)init {
self = [super init];
if (self != nil) {
_transactions = [[NSMutableDictionary alloc] init];
_transactionQueue = dispatch_queue_create("io.invertase.react-native-firebase.firestore", DISPATCH_QUEUE_CONCURRENT);
_transactionQueue = dispatch_queue_create("io.invertase.react-native-firebase.firestore.transactions", DISPATCH_QUEUE_CONCURRENT);
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion ios/RNFirebase/storage/RNFirebaseStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ @implementation RNFirebaseStorage

// Run on a different thread
- (dispatch_queue_t)methodQueue {
return dispatch_queue_create("com.invertase.firebase.storage", DISPATCH_QUEUE_SERIAL);
return dispatch_queue_create("io.invertase.react-native-firebase.storage", DISPATCH_QUEUE_SERIAL);
}

/**
Expand Down

0 comments on commit fa9bac1

Please sign in to comment.