aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/RxLibrary
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-07-17 23:13:36 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-07-18 00:29:44 -0700
commit4c6f778cfd4ce9e28f12db10a922c26785e96b94 (patch)
tree715a44d590134d9bfee5d34425ad53ec7f0f1a10 /src/objective-c/RxLibrary
parent35f003b24eb26c1e51faf2ba8df4ab5784d17133 (diff)
ConcurrentWriteable: NSData *message -> id value
Diffstat (limited to 'src/objective-c/RxLibrary')
-rw-r--r--src/objective-c/RxLibrary/GRXConcurrentWriteable.h8
-rw-r--r--src/objective-c/RxLibrary/GRXConcurrentWriteable.m4
2 files changed, 5 insertions, 7 deletions
diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
index 5d1e1dafc0..018af46150 100644
--- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
+++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h
@@ -33,9 +33,8 @@
#import <Foundation/Foundation.h>
-#import <RxLibrary/GRXWriter.h>
-
-@protocol GRXWriteable;
+#import "GRXWriter.h"
+#import "GRXWriteable.h"
// This is a thread-safe wrapper over a GRXWriteable instance. It lets one
// enqueue calls to a GRXWriteable instance for the main thread, guaranteeing
@@ -47,7 +46,6 @@
//
// TODO(jcanizales): Let the user specify another queue for the writeable
// callbacks.
-// TODO(jcanizales): Rename to GRXWriteableWrapper and move to the Rx library.
@interface GRXConcurrentWriteable : NSObject
// The GRXWriteable passed is the wrapped writeable.
@@ -60,7 +58,7 @@
// Enqueues writeValue: to be sent to the writeable in the main thread.
// The passed handler is invoked from the main thread after writeValue: returns.
-- (void)enqueueMessage:(NSData *)message completionHandler:(void (^)())handler;
+- (void)enqueueValue:(id)value completionHandler:(void (^)())handler;
// Enqueues writesFinishedWithError:nil to be sent to the writeable in the main
// thread. After that message is sent to the writeable, all other methods of
diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
index b71098d73b..735df3137b 100644
--- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
+++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m
@@ -61,7 +61,7 @@
return self;
}
-- (void)enqueueMessage:(NSData *)message completionHandler:(void (^)())handler {
+- (void)enqueueValue:(id)value completionHandler:(void (^)())handler {
dispatch_async(_writeableQueue, ^{
// We're racing a possible cancellation performed by another thread. To turn
// all already-enqueued messages into noops, cancellation nillifies the
@@ -69,7 +69,7 @@
// the race.
id<GRXWriteable> writeable = self.writeable;
if (writeable) {
- [writeable writeValue:message];
+ [writeable writeValue:value];
handler();
}
});