aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jorge Canizales <jcanizales@google.com>2015-05-18 17:19:16 -0700
committerGravatar Jorge Canizales <jcanizales@google.com>2015-05-19 16:05:31 -0700
commitb2c300c4be537c54f3adcaf3ca190b9bce002fab (patch)
tree6508e5939be7fadcb95e8b536d9ccaa9d8de1ad3
parenta90a9c395d86b5f1e6b123ae25de14c7f0362040 (diff)
s/didFinishWithError/writesFinishedWithError
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m4
-rw-r--r--src/objective-c/GRPCClient/private/GRPCDelegateWrapper.h12
-rw-r--r--src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m6
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m2
-rw-r--r--src/objective-c/RxLibrary/GRXBufferedPipe.h2
-rw-r--r--src/objective-c/RxLibrary/GRXBufferedPipe.m4
-rw-r--r--src/objective-c/RxLibrary/GRXImmediateWriter.m2
-rw-r--r--src/objective-c/RxLibrary/GRXWriteable.h3
-rw-r--r--src/objective-c/RxLibrary/GRXWriteable.m2
-rw-r--r--src/objective-c/RxLibrary/GRXWriter.h6
-rw-r--r--src/objective-c/RxLibrary/GRXWriter.m4
-rw-r--r--src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m2
12 files changed, 24 insertions, 25 deletions
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index b909c0944b..a4a0ddb324 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -255,7 +255,7 @@
errorHandler:errorHandler];
}
-- (void)didFinishWithError:(NSError *)errorOrNil {
+- (void)writesFinishedWithError:(NSError *)errorOrNil {
if (errorOrNil) {
[self cancel];
} else {
@@ -306,7 +306,7 @@
- (void)startWithWriteable:(id<GRXWriteable>)writeable {
// The following produces a retain cycle self:_responseWriteable:self, which is only
- // broken when didFinishWithError: is sent to the wrapped writeable.
+ // broken when writesFinishedWithError: is sent to the wrapped writeable.
// Care is taken not to retain self strongly in any of the blocks used in
// the implementation of GRPCCall, so that the life of the instance is
// determined by this retain cycle.
diff --git a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.h b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.h
index 6103d4829d..1ef245fe37 100644
--- a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.h
+++ b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.h
@@ -38,11 +38,11 @@
// This is a thread-safe wrapper over a GRXWriteable instance. It lets one
// enqueue calls to a GRXWriteable instance for the main thread, guaranteeing
-// that didFinishWithError: is the last message sent to it (no matter what
+// that writesFinishedWithError: is the last message sent to it (no matter what
// messages are sent to the wrapper, in what order, nor from which thread). It
// also guarantees that, if cancelWithError: is called from the main thread
// (e.g. by the app cancelling the writes), no further messages are sent to the
-// writeable except didFinishWithError:.
+// writeable except writesFinishedWithError:.
//
// TODO(jcanizales): Let the user specify another queue for the writeable
// callbacks.
@@ -51,7 +51,7 @@
// The GRXWriteable passed is the wrapped writeable.
// Both the GRXWriter instance and the GRXWriteable instance are retained until
-// didFinishWithError: is sent to the writeable, and released after that.
+// writesFinishedWithError: is sent to the writeable, and released after that.
// This is used to create a retain cycle that keeps both objects alive until the
// writing is explicitly finished.
- (instancetype)initWithWriteable:(id<GRXWriteable>)writeable writer:(id<GRXWriter>)writer
@@ -61,12 +61,12 @@
// The passed handler is invoked from the main thread after writeValue: returns.
- (void)enqueueMessage:(NSData *)message completionHandler:(void (^)())handler;
-// Enqueues didFinishWithError:nil to be sent to the writeable in the main
+// 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
// this object are effectively noops.
- (void)enqueueSuccessfulCompletion;
-// If the writeable has not yet received a didFinishWithError: message, this
+// If the writeable has not yet received a writesFinishedWithError: message, this
// will enqueue one to be sent to it in the main thread, and cancel all other
// pending messages to the writeable enqueued by this object (both past and
// future).
@@ -74,7 +74,7 @@
- (void)cancelWithError:(NSError *)error;
// Cancels all pending messages to the writeable enqueued by this object (both
-// past and future). Because the writeable won't receive didFinishWithError:,
+// past and future). Because the writeable won't receive writesFinishedWithError:,
// this also releases the writeable and the writer.
- (void)cancelSilently;
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
index b8f206ad23..7d5ecb56d9 100644
--- a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
+++ b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
@@ -43,7 +43,7 @@
@implementation GRPCDelegateWrapper {
dispatch_queue_t _writeableQueue;
- // This ensures that didFinishWithError: is only sent once to the writeable.
+ // This ensures that writesFinishedWithError: is only sent once to the writeable.
dispatch_once_t _alreadyFinished;
}
@@ -80,7 +80,7 @@
dispatch_once(&_alreadyFinished, ^{
// Cancellation is now impossible. None of the other three blocks can run
// concurrently with this one.
- [self.writeable didFinishWithError:nil];
+ [self.writeable writesFinishedWithError:nil];
// Break the retain cycle with writer, and skip any possible message to the
// wrapped writeable enqueued after this one.
self.writeable = nil;
@@ -100,7 +100,7 @@
self.writeable = nil;
dispatch_async(_writeableQueue, ^{
- [writeable didFinishWithError:error];
+ [writeable writesFinishedWithError:error];
// Break the retain cycle with writer.
self.writer = nil;
});
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index e4bc48a69f..96608f2898 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -73,7 +73,7 @@
_responseWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
[responsesWriteable writeValue:[responseClass parseFromData:value]];
} completionHandler:^(NSError *errorOrNil) {
- [responsesWriteable didFinishWithError:errorOrNil];
+ [responsesWriteable writesFinishedWithError:errorOrNil];
}];
}
return self;
diff --git a/src/objective-c/RxLibrary/GRXBufferedPipe.h b/src/objective-c/RxLibrary/GRXBufferedPipe.h
index 86d12853b0..68a1695a4b 100644
--- a/src/objective-c/RxLibrary/GRXBufferedPipe.h
+++ b/src/objective-c/RxLibrary/GRXBufferedPipe.h
@@ -43,7 +43,7 @@
// If it is throttled and keeps receiving values, as well as if it receives values before being
// started, it will buffer them and propagate them in order as soon as its state becomes
// GRXWriterStateStarted.
-// If it receives an error (via -didFinishWithError:), it will drop any buffered values and
+// If it receives an error (via -writesFinishedWithError:), it will drop any buffered values and
// propagate the error immediately.
@interface GRXBufferedPipe : NSObject<GRXWriteable, GRXWriter>
diff --git a/src/objective-c/RxLibrary/GRXBufferedPipe.m b/src/objective-c/RxLibrary/GRXBufferedPipe.m
index 0230f14c36..e14e15df70 100644
--- a/src/objective-c/RxLibrary/GRXBufferedPipe.m
+++ b/src/objective-c/RxLibrary/GRXBufferedPipe.m
@@ -88,7 +88,7 @@
}
}
-- (void)didFinishWithError:(NSError *)errorOrNil {
+- (void)writesFinishedWithError:(NSError *)errorOrNil {
_inputIsFinished = YES;
_errorOrNil = errorOrNil;
if (errorOrNil || self.shouldFastForward) {
@@ -136,7 +136,7 @@
- (void)finishWithError:(NSError *)errorOrNil {
id<GRXWriteable> writeable = _writeable;
self.state = GRXWriterStateFinished;
- [writeable didFinishWithError:errorOrNil];
+ [writeable writesFinishedWithError:errorOrNil];
}
@end
diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.m b/src/objective-c/RxLibrary/GRXImmediateWriter.m
index 7108a56584..0b4979872e 100644
--- a/src/objective-c/RxLibrary/GRXImmediateWriter.m
+++ b/src/objective-c/RxLibrary/GRXImmediateWriter.m
@@ -130,7 +130,7 @@
_errorOrNil = nil;
id<GRXWriteable> writeable = _writeable;
_writeable = nil;
- [writeable didFinishWithError:errorOrNil];
+ [writeable writesFinishedWithError:errorOrNil];
}
- (void)setState:(GRXWriterState)newState {
diff --git a/src/objective-c/RxLibrary/GRXWriteable.h b/src/objective-c/RxLibrary/GRXWriteable.h
index d1bcb51799..216de30735 100644
--- a/src/objective-c/RxLibrary/GRXWriteable.h
+++ b/src/objective-c/RxLibrary/GRXWriteable.h
@@ -43,8 +43,7 @@
// Signal that the sequence is completed, or that an error ocurred. After this
// message is sent to the instance, neither it nor writeValue: may be
// called again.
-// TODO(jcanizales): enumerator:(id<GRXEnumerator>) didFinishWithError:(NSError*)?
-- (void)didFinishWithError:(NSError *)errorOrNil;
+- (void)writesFinishedWithError:(NSError *)errorOrNil;
@end
typedef void (^GRXValueHandler)(id value);
diff --git a/src/objective-c/RxLibrary/GRXWriteable.m b/src/objective-c/RxLibrary/GRXWriteable.m
index d3ee7fa170..63f7c3e7f3 100644
--- a/src/objective-c/RxLibrary/GRXWriteable.m
+++ b/src/objective-c/RxLibrary/GRXWriteable.m
@@ -82,7 +82,7 @@
}
}
-- (void)didFinishWithError:(NSError *)errorOrNil {
+- (void)writesFinishedWithError:(NSError *)errorOrNil {
if (_completionHandler) {
_completionHandler(errorOrNil);
}
diff --git a/src/objective-c/RxLibrary/GRXWriter.h b/src/objective-c/RxLibrary/GRXWriter.h
index 68c294f007..dcf44e3143 100644
--- a/src/objective-c/RxLibrary/GRXWriter.h
+++ b/src/objective-c/RxLibrary/GRXWriter.h
@@ -50,7 +50,7 @@ typedef NS_ENUM(NSInteger, GRXWriterState) {
// The writer is temporarily paused, and won't send any more values to the
// writeable unless its state is set back to Started. The writer might still
// transition to the Finished state at any moment, and is allowed to send
- // didFinishWithError: to its writeable.
+ // writesFinishedWithError: to its writeable.
//
// Not all implementations of writer have to support pausing, and thus
// trying to set an writer's state to this value might have no effect.
@@ -59,7 +59,7 @@ typedef NS_ENUM(NSInteger, GRXWriterState) {
// The writer has released its writeable and won't interact with it anymore.
//
// One seldomly wants to set an writer's state to this value, as its
- // writeable isn't notified with a didFinishWithError: message. Instead, sending
+ // writeable isn't notified with a writesFinishedWithError: message. Instead, sending
// finishWithError: to the writer will make it notify the writeable and then
// transition to this state.
GRXWriterStateFinished
@@ -105,7 +105,7 @@ typedef NS_ENUM(NSInteger, GRXWriterState) {
// This method might only be called on writers in the NotStarted state.
- (void)startWithWriteable:(id<GRXWriteable>)writeable;
-// Send didFinishWithError:errorOrNil immediately to the writeable, and don't send
+// Send writesFinishedWithError:errorOrNil immediately to the writeable, and don't send
// any more messages to it.
//
// This method might only be called on writers in the Started or Paused
diff --git a/src/objective-c/RxLibrary/GRXWriter.m b/src/objective-c/RxLibrary/GRXWriter.m
index 140284b938..cc14383560 100644
--- a/src/objective-c/RxLibrary/GRXWriter.m
+++ b/src/objective-c/RxLibrary/GRXWriter.m
@@ -62,7 +62,7 @@
- (void)finishOutputWithError:(NSError *)errorOrNil {
id<GRXWriteable> writeable = _writeable;
_writeable = nil;
- [writeable didFinishWithError:errorOrNil];
+ [writeable writesFinishedWithError:errorOrNil];
}
// This is used to stop the input writer. It nillifies our reference to it
@@ -79,7 +79,7 @@
[_writeable writeValue:value];
}
-- (void)didFinishWithError:(NSError *)errorOrNil {
+- (void)writesFinishedWithError:(NSError *)errorOrNil {
_writer = nil;
[self finishOutputWithError:errorOrNil];
}
diff --git a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m b/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m
index 51965a1dd7..7e063fddb4 100644
--- a/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m
+++ b/src/objective-c/examples/Sample/SampleTests/RemoteProtoTests.m
@@ -227,7 +227,7 @@
requestedResponseSize:responses[index]];
[requestsBuffer writeValue:request];
} else {
- [requestsBuffer didFinishWithError:nil];
+ [requestsBuffer writesFinishedWithError:nil];
}
}