You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-30Lines changed: 40 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,40 +1,42 @@
1
1
# STNetTaskQueue
2
-
Queue for managing network requests
2
+
STNetTaskQueue is a networking queue library for iOS and OS X. It's abstract and can be implemented in different protocols.
3
3
4
-
STNetTaskQueue may be your choice if you want to handle each network request stuff in separated STNetTask instead of having all the network requests logics in a "Manager" class.
4
+
STNetTaskQueue avoid you from directly dealing with "url", "request packing" and "response parsing". All networking tasks are described and processed by subclassing STNetTask, which provides you a clean code style in UI layer when handling networking.
5
5
6
-
**STHTTPNetTaskQueueHandler** is included, which is for HTTP based network reqeust. If you are looking for a socket or other protocol based handler, currently you should write your own net task queue handler and conform to **STNetTaskQueueHandler** protocol. **STHTTPNetTaskQeueuHandler** depends on [AFNetworking](https://github.com/AFNetworking/AFNetworking), which is included in example project.
6
+
## STHTTPNetTaskQueueHandler
7
7
8
-
## Features
9
-
- Retry net task with specified max retry count.
10
-
- Delegate for net task result according to "uri" of net task.
11
-
- More features are coming as STNetTaskQueue is extendible.
8
+
STHTTPNetTaskQueueHandler is a HTTP based implementation of STNetTaskQueueHandler. It provides different ways to pack request and parse response, e.g. STHTTPNetTaskRequestJSON is for JSON format request body, STHTTPNetTaskResponseJSON is for JSON format response data and STHTTPNetTaskRequestFormData is for form data format request body which is mostly used for uploading file.
STNetTask is abstract, it provides basic properties and callbacks for subclassing.
13
+
14
+
## STNetTaskDelegate
15
+
16
+
STNetTaskDelegate is the delegate protocol for observing result of STNetTask, mostly it is used in view controller.
17
17
18
-
### Installation with CocoaPods
18
+
##STNetTaskChain
19
19
20
-
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking).
20
+
STNetTaskChain is a chain which processes an array of STNetTask serially. A net task chain is considered as successful only if all net tasks in the chain are end without error.
21
+
22
+
## Get Started
21
23
22
-
####Podfile
24
+
### Podfile
23
25
24
26
```ruby
25
27
platform :ios, '7.0'
26
-
pod 'STNetTaskQueue', '~> 0.0.1'
28
+
pod 'STNetTaskQueue', '~> 0.0.2'
27
29
```
28
30
29
-
31
+
### Use STNetTaskQueue in your project
30
32
#### Step 1: Setup STNetTaskQueue after your app launch
0 commit comments