Commit Graph

39 Commits

Author SHA1 Message Date
Blake Watters
479864902b Fixed all build warnings on OS X Framework target 2011-12-08 23:23:20 -05:00
Blake Watters
563f5e909b Updated all example projects to build against the new project. Cleaned up header imports for flattened project structure 2011-12-02 09:26:36 -05:00
Blake Watters
f5008ff9fe Cleaned up broken specs for iOS. 2011-12-02 09:26:35 -05:00
Parker
e8b24a3959 added apache license to everything in the Network directory
I got tired of doing individual commits for each file, so I just did the
rest of the directory.
2011-09-07 10:45:42 -04:00
Blake Watters
d9d0f7a650 Eliminated the global sharedQueue in favor of allowing each RKClient to own its a private queue. This eliminates problems where multiple clients are tracking reachability notifications and mutating the suspension state on a single queue. If you want to use a single queue across multiple RKClient instances, you can assign a single queue to both and worry about suspension and reachability yourself. fixes #278 2011-09-03 15:52:45 -04:00
Blake Watters
b96940cc64 Eliminated requirement to use -all_load linker flag. Fixed breakage in OS X builds due to ivar/property name disagreement. Removed references to all_load from the install docs. fixes #239 2011-09-01 20:52:46 -04:00
Blake Watters
0640f20bd2 Added newRequestQueueWithName to the API 2011-08-18 13:00:51 -04:00
Blake Watters
84032d9aa6 De-emphasized the use of the sharedQueue and improved management of queue suspension state when changing out the baseURL on RKClient. This should prevent the queue from becoming suspended beyond the life of an RKClient that suspended it. Queues are now also properties on a per-client and per-request basis, so it is easier to segregated parts of your app into different queues. The relationship between RKRequest and RKRequestQueue should be decoupled at some point. 2011-08-18 11:48:37 -04:00
Victor Kryukov
e5dd917209 Fix #180 - Network Activity Indicator Gets Clobbered by Multiple Queues 2011-08-12 12:55:55 -07:00
Blake Watters
7246afc998 Fixes to enable RestKit Core Data to be easily unit tested from a Unit Testing bundle. Improved thread safety in the request queue and fixed an issue where requests dispatched from background threads would not get callback methods due to thread termination. The request queue now guarantees requests are sent from the main thread. 2011-07-21 11:33:17 -04:00
Blake Watters
5a2f937a52 Reworked notifications for consistency with Cocoa idioms. Simplified code paths through the queue. Tweaked the logging for easier info at the Debug level without having to drop down to Trace. 2011-06-29 16:18:18 -04:00
Blake Watters
853704b2fd Rework notifications to allow request queue to observe only the requests it dispatches instead of all of them. Fixes incorrectly decrementing loading count. 2011-06-29 15:36:10 -04:00
Blake Watters
2a8ece97c1 Improvements to reachability, the request queue, logging throughout the network layer, decoupling of components via notifications, reliability improvements for unit tests in the cache layer. Improved thread-local cleanup routines inside the managed object store. Changing base URL's is now more reliable. fixes #171, #158, #113, #104, #102 2011-06-29 13:28:14 -04:00
Blake Watters
8fe8e5cc75 Rework queue iteration to use a while loop and maintain a count of dequeued requests to ensure finite iteration. refs #164 2011-06-28 19:20:17 -04:00
Blake Watters
1cfa273224 Added new logging to the RKRequestQueue for inspecting what is happening. Eliminated use of copy during iteration of the request queue to avoid issues with re-entrant invocations of the queue resulting in the queue becoming starved. Fixed a number of flaky tests by making the RKSpec helpers stub out network availability. closes #164 2011-06-28 18:18:49 -04:00
Blake Watters
f2ceefa012 Merge Request Queue (See issue #75):
* Introduces RKRequestCache for cacheing responses (supports ETag conditional GET, use cache if available, use cache on error, etc.) closes #75
    * Updates to Three20 layer to eliminate need for intermediary TTTableItem classes closes #76
    * Fixes to ensure iOS 3.x compatability:
        * Switched compiler to Clang
        * Updated conditional checks for UIBackgroundTask symbols to ensure runtime safety on iOS 3.x
        * Removed unnecessary linkage against UIKit and CoreFoundation from library targets
    * Fix for issue where RKRequest objects could become stuck in infinite loop within RKRequestQueue loadNextInQueue if you start
      a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. refs #122
2011-06-11 19:28:44 -04:00
Scott Penrose
d6bd24a350 RKRequestQueue loadNextInQueue stuck in infinite loop if you start a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. This needs to be merged into master #122 2011-05-29 00:52:16 -04:00
Blake Watters
1437026e43 Fail out build process when run_command encounters non-zero exit status. Fixed OS X compile issues introduced by automatic network activity indicator. refs #57 2011-04-19 13:13:34 -04:00
Blake Watters
381ccadbe2 Added support for spinning the Network activity indicator when busy 2011-04-19 09:59:57 -04:00
Blake Watters
7837e245d9 Implemented support and tests for queue processing delegate methods. 2011-04-19 09:38:25 -04:00
Chad Podoski
f44abbee27 Generalize RKRequestQueue and add NSDecimalNumber type support to RKObjectMapper. refs #50 2011-04-18 17:21:01 -04:00
Blake Watters
9593612aab Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren (https://github.com/Felixyz/RestKit).
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa.
* Added macosx to supported platforms to enable build on OS X.
* Configured project to use conditional architectures to enable building on OS X and iOS from the same targets.
* Implemented a bare-bones OS X example app.
* Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
2011-04-12 21:02:25 -04:00
Blake Watters
a648d26460 [#11477593] Implemented background request policies and Specs. This provides functionality for continuing a request in the background using an iOS background task.
Introduces four modes for handling background requests:
* RKRequestBackgroundPolicyNone - The default behavior replicating pre-background behavior. No special action is taken with regards to backgrounding.
* RKRequestBackgroundPolicyCancel - On transition to the background, requests with this policy set will be cancelled automatically and the delegate informed.
* RKRequestBackgroundPolicyContinue - Requests with this policy will be continued in the background after the app has been transitioned.
* RKRequestBackgroundPolicyRequeue - Requests with this policy will be cancelled and then immediately placed onto the queue for processing the next time the app is returned to the foreground.
2011-04-05 13:06:06 -04:00
Blake Watters
7589060e6d Merge branch '0.9' of github.com:twotoasters/RestKit into 0.9 2011-04-05 10:06:43 -04:00
Jeremy Ellison
322599e14a Updates from development of Go Try It On v2.0:
* Updates YAJL Parser not to raise an exception and crash when it encounters invalid JSON. The other parsers need to be aligned with this behavior and the delegate methods updated. See Pivotal Story: https://www.pivotaltracker.com/story/show/11925617
* Added requestDidCancel: delegate invocation for tracking cancellation of requests.
* Ensure that the request queue timer is cleared during indeterminate deferral of request loads.
2011-04-05 10:02:34 -04:00
Blake Watters
c23eac631d remove unconnected timeout constant 2011-04-04 19:43:21 -04:00
Blake Watters
c90ec2770d Finished cleanup of HTTP AUTH and XML Support. Ready to tag 0.9.1 2011-03-28 23:29:06 -04:00
Jeff Arena
797904d5a1 use copy of requests array when use fast enumeration in loadNextInQueue; add autorelease pools to methods that copy the request array to ensure we immediately clean up our copies upon completion 2011-03-23 08:33:33 -07:00
Blake Watters
bf48cf6559 More Xcode 4 crap 2011-02-15 20:25:22 -05:00
Jeremy Ellison
6a5ee2af7e Revert "Remove per-file copyrights"
This reverts commit 91e7c6bb5e.
2011-01-12 15:27:19 -05:00
Jeremy Ellison
91e7c6bb5e Remove per-file copyrights 2011-01-12 15:05:22 -05:00
Jeff Arena
88489747e8 add additional response convenience method for checking for a 503 response code; quiet a compiler warning regarding depracated client class method; add default support for generating a uialertview when restkit encounters a 503 response; added ability to turn 503 error on/off, as well as ability to customize the alert 2011-01-06 11:55:43 -08:00
Jeremy Ellison
b31e6426a5 Add new RKReachabilityState, RKReachabilityIndeterminate.
Make RKRequestQueue smart, don't start dequeuing requests until reachability state has been determined.
Simplify examples.
2011-01-06 14:12:14 -05:00
Jeff Arena
e991ad7033 change RKRequest delegate didfinishload method signature to be a bit cleaner; added code to turn off the reachability observer when the app becomes inactive; changed online/offline state code to support an undetermined state at initial launch, so as to ensure we get all our proper notifications during first run; remove unnecessary debug logging from rkrequestqueue; removed three20 model code that was triggering a forced offline state, which currently does not have a recovery path (e.g. if the app is forced offline, we currently have no built-in mechanism to allow a force back online) 2010-12-08 09:45:26 -08:00
Jeff Arena
d91223b6fa fixed a crash related to parsing a non-JSON error from a response string; fixed issue with callbacks being fired after a request has been cancelled; fixed leak of resourcePath in RKRequestTTModel; fixed issue with autoreleasepool being drained before background thread objects have been transferred to the callback method; fixed issues with mutating the requestqueue array during enumeration while performing bulk cancels; added additional logging that has been helpful in tracking down many of these crashes (to be removed prior to merge to master) 2010-12-02 19:28:25 -08:00
Jeff Arena
507509fd3e bug fixes for issues related to error conditions that were preventing our request lifecycle from completing correctly 2010-12-02 14:17:58 -08:00
Jeff Arena
c9ba879937 removed duplicate delegates on RKObjectLoader; inverted control for communicating request completion from RKResponse to RKRequest; added state tracking to RKRequest for loaded and loading states; changed queue processing logic to check request states before firing new requests; removed retains of RKObjectLoader from RKRequestTTModel since our queue is handling retains for all asynchronous RKRequest flavors; added separate state tracking to RKRequestTTModel since there are subtle differences between the meaning of loaded/loading in Three20 versus our RKRequest states; removed delegate forwarding code from RKObjectLoader since it is no longer an RKRequestDelegate (which was quite ugly to begin with); removed unnecessary error contructor for RKResponse that was only being used to fire delegate callbacks when an RKRequest failed to fire in offline mode; added TODOs to deep-dive into synchronous request handling 2010-12-02 13:22:38 -08:00
Jeff Arena
6249ece2bc Merge branch 'reachability-queue-three20' of git://github.com/twotoasters/RestKit into reachability-queue-three20
Conflicts:
	Code/Network/RKRequest.m
	RestKit.xcodeproj/project.pbxproj
2010-12-01 21:06:54 -08:00
Blake Watters
a53f28e339 First cut at queue support. 2010-12-01 14:56:16 -05:00