Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 35376b69527078862fe879654a8c21635c0ea7af @JimRoepcke JimRoepcke committed Feb 7, 2011
Showing with 3,074 additions and 0 deletions.
  1. +57 −0 Documentation/images/twisted/LICENSE.txt
  2. BIN Documentation/images/twisted/deferred-attach.png
  3. BIN Documentation/images/twisted/deferred-process.png
  4. BIN Documentation/images/twisted/deferred.png
  5. +15 −0 HLDeferred/.gitignore
  6. +65 −0 HLDeferred/Classes/HLDeferred.h
  7. +266 −0 HLDeferred/Classes/HLDeferred.m
  8. +23 −0 HLDeferred/Classes/HLDeferredConcurrentDataSource.h
  9. +103 −0 HLDeferred/Classes/HLDeferredConcurrentDataSource.m
  10. +73 −0 HLDeferred/Classes/HLDeferredDataSource.h
  11. +84 −0 HLDeferred/Classes/HLDeferredDataSource.m
  12. +32 −0 HLDeferred/Classes/HLDeferredList.h
  13. +129 −0 HLDeferred/Classes/HLDeferredList.m
  14. +18 −0 HLDeferred/Classes/HLDownloadDataSource.h
  15. +110 −0 HLDeferred/Classes/HLDownloadDataSource.m
  16. +19 −0 HLDeferred/Classes/HLFailure.h
  17. +41 −0 HLDeferred/Classes/HLFailure.m
  18. +13 −0 HLDeferred/Classes/HLJSONDataSource.h
  19. +34 −0 HLDeferred/Classes/HLJSONDataSource.m
  20. +41 −0 HLDeferred/Classes/HLURLDataSource.h
  21. +164 −0 HLDeferred/Classes/HLURLDataSource.m
  22. +1 −0 HLDeferred/Frameworks/.gitignore
  23. +525 −0 HLDeferred/HLDeferred.xcodeproj/project.pbxproj
  24. +13 −0 HLDeferred/HLDeferred_Prefix.pch
  25. +82 −0 HLDeferred/Tests/GHUnitIOSTestMain.m
  26. +70 −0 HLDeferred/Tests/HLDeferredConcurrentDataSourceTest.m
  27. +68 −0 HLDeferred/Tests/HLDeferredDataSourceTest.m
  28. +268 −0 HLDeferred/Tests/HLDeferredListTest.m
  29. +233 −0 HLDeferred/Tests/HLDeferredTest.m
  30. +20 −0 HLDeferred/Tests/HLDeferredTests-Info.plist
  31. +14 −0 HLDeferred/Tests/HLDeferredTests_Prefix.pch
  32. +105 −0 HLDeferred/Tests/HLDownloadDataSourceTest.m
  33. +61 −0 HLDeferred/Tests/HLJSONDataSourceTest.m
  34. +84 −0 HLDeferred/Tests/HLURLDataSourceTest.m
  35. +18 −0 LICENSE
  36. +225 −0 README.md
@@ -0,0 +1,57 @@
+Copyright (c) 2001-2010
+Allen Short
+Andy Gayton
+Andrew Bennetts
+Antoine Pitrou
+Apple Computer, Inc.
+Benjamin Bruheim
+Bob Ippolito
+Canonical Limited
+Christopher Armstrong
+David Reid
+Donovan Preston
+Eric Mangold
+Eyal Lotem
+Itamar Shtull-Trauring
+James Knight
+Jason A. Mobarak
+Jean-Paul Calderone
+Jessica McKellar
+Jonathan Jacobs
+Jonathan Lange
+Jonathan D. Simms
+Jürgen Hermann
+Kevin Horn
+Kevin Turner
+Mary Gardiner
+Matthew Lefkowitz
+Massachusetts Institute of Technology
+Moshe Zadka
+Paul Swartz
+Pavel Pergamenshchik
+Ralph Meijer
+Sean Riley
+Software Freedom Conservancy
+Travis B. Hartwell
+Thijs Triemstra
+Thomas Herve
+Timothy Allen
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,15 @@
+build
+
+*.pbxuser
+*.perspectivev3
+*.mode1v3
+*.mode2v3
+!default.pbxuser
+!default.perspectivev3
+!default.mode1v3
+!default.mode2v3
+
+*~.nib
+*~.xib
+
+.DS_Store
@@ -0,0 +1,65 @@
+//
+// HLDeferred.h
+// HLDeferred
+//
+// Copyright 2011 HeavyLifters Network Ltd.. All rights reserved.
+// See included LICENSE file (MIT) for licensing information.
+//
+
+#import "HLFailure.h"
+
+extern NSString * const kHLDeferredCancelled;
+
+typedef id (^ThenBlock)(id result);
+typedef id (^FailBlock)(HLFailure *failure);
+
+@class HLDeferred;
+
+@protocol HLDeferredCancellable <NSObject>
+
+- (void) deferredWillCancel: (HLDeferred *)d;
+
+@end
+
+@interface HLDeferred : NSObject
+{
+ BOOL finalized_;
+ BOOL called_;
+ BOOL suppressAlreadyCalled_;
+ BOOL running_;
+ id result_;
+ NSInteger pauseCount_;
+ NSMutableArray *callbacks_;
+ id <HLDeferredCancellable> canceller_;
+ ThenBlock finalizer_;
+}
+
+@property (nonatomic, assign) id <HLDeferredCancellable> canceller;
+@property (nonatomic, readonly, assign, getter=isCalled) BOOL called;
+
+// designated initializer
+- (id) initWithCanceller: (id <HLDeferredCancellable>) theCanceller;
+- (id) init; // calls initWithCanceller: nil
+
++ (HLDeferred *) deferredWithResult: (id)result;
++ (HLDeferred *) deferredWithError: (id)error;
+
+- (HLDeferred *) then: (ThenBlock)cb;
+- (HLDeferred *) fail: (FailBlock)eb;
+- (HLDeferred *) both: (ThenBlock)bb;
+
+- (HLDeferred *) then: (ThenBlock)cb fail: (FailBlock)eb;
+
+- (HLDeferred *) thenReturn: (id)aResult;
+
+- (HLDeferred *) thenFinally: (ThenBlock)aThenFinalizer;
+- (HLDeferred *) failFinally: (FailBlock)aFailFinalizer;
+- (HLDeferred *) bothFinally: (ThenBlock)aBothFinalizer;
+
+- (HLDeferred *) thenFinally: (ThenBlock)atThenFinalizer failFinally: (FailBlock)aFailFinalizer;
+
+- (HLDeferred *) takeResult: (id)aResult;
+- (HLDeferred *) takeError: (id)anError;
+- (void) cancel;
+
+@end
Oops, something went wrong.

0 comments on commit 35376b6

Please sign in to comment.