Skip to content
Browse files

updated readme with pauseThread and resumeThread info

  • Loading branch information...
1 parent 8df73e1 commit 8b3d5ca1de047f4c8e3b6afae71821d2a9c844f0 @stevedekorte committed Sep 14, 2012
View
BIN ...xcodeproj/project.xcworkspace/xcuserdata/steve.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
35 README.txt
@@ -59,7 +59,39 @@ BatchProxy
Sends concurrent fetch messages to each element of the urls array and returns
an array containing the results.
-
+
+
+
+Dealing with Async Callbacks
+
+ To deal with async callbacks within an actor's thread, pauseThread and resumeThread can be used. Example:
+
+
+ __block id response = nil;
+ __block NSError *error = nil;
+ __block ActorProxy *actor = [ActorProxy currentActorProxy];
+
+ _request = [s3Client getBucket:_bucketName
+ success:^(id responseObject)
+ {
+ response = responseObject;
+ [actor resumeThread];
+ }
+ failure:^(NSError *e)
+ {
+ error = e;
+ [actor resumeThread];
+ }
+ ];
+
+ id returnValue = [[ActorProxy currentActorProxy] pauseThread];
+
+ if(error)
+ {
+ [NSException raise:@"SyncKitError" format:[error description]];
+ }
+
+ Also, if the thread is resumed using resumeThreadWithValue:, the pauseThread method will return the given value.
Notes
@@ -76,6 +108,7 @@ Notes
+
To Do
- handle BatchProxy exceptions

0 comments on commit 8b3d5ca

Please sign in to comment.
Something went wrong with that request. Please try again.