commit | author | age
|
a0a843
|
1 |
// |
H |
2 |
// TWTRNetworkingPipelinePackage.h |
|
3 |
// TwitterKit |
|
4 |
// |
|
5 |
// Created by Chase Latta on 6/22/15. |
|
6 |
// Copyright (c) 2015 Twitter. All rights reserved. |
|
7 |
// |
|
8 |
|
|
9 |
#import <TwitterCore/TWTRSessionStore.h> |
|
10 |
#import "TWTRNetworkingPipeline.h" |
|
11 |
|
|
12 |
NS_ASSUME_NONNULL_BEGIN |
|
13 |
|
|
14 |
@interface TWTRNetworkingPipelinePackage : NSObject <NSCopying> |
|
15 |
|
|
16 |
/** |
|
17 |
* The URL request object that will be executed by this package. |
|
18 |
*/ |
|
19 |
@property (nonatomic, copy, readonly) NSURLRequest *request; |
|
20 |
|
|
21 |
/** |
|
22 |
* The session store that will be used by the package to provide session information. |
|
23 |
*/ |
|
24 |
@property (nonatomic, readonly) id<TWTRSessionStore> sessionStore; |
|
25 |
|
|
26 |
/** |
|
27 |
* The userID associated with this package or nil to signify that |
|
28 |
* the guest session should be used. |
|
29 |
*/ |
|
30 |
@property (nonatomic, copy, readonly, nullable) NSString *userID; |
|
31 |
|
|
32 |
/** |
|
33 |
The calback block to execute when the request is finished or fails. |
|
34 |
*/ |
|
35 |
@property (nonatomic, copy, readonly, nullable) TWTRNetworkingPipelineCallback callback; |
|
36 |
|
|
37 |
/** |
|
38 |
A counter to track the attempts (with retries) of the request operation associated with the this package. It can be useful |
|
39 |
to avoid retrying a request indefinitely (stop after certain threshold). It starts with 1 |
|
40 |
*/ |
|
41 |
@property (nonatomic, readonly) NSInteger attemptCounter; |
|
42 |
|
|
43 |
/** |
|
44 |
* A UUI associated with this package. |
|
45 |
*/ |
|
46 |
@property (nonatomic, readonly) NSUUID *UUID; |
|
47 |
|
|
48 |
- (instancetype)initWithRequest:(NSURLRequest *)request sessionStore:(id<TWTRSessionStore>)sessionStore userID:(nullable NSString *)userID completion:(nullable TWTRNetworkingPipelineCallback)callback NS_DESIGNATED_INITIALIZER; |
|
49 |
|
|
50 |
+ (instancetype)packageWithRequest:(NSURLRequest *)request sessionStore:(id<TWTRSessionStore>)sessionStore userID:(nullable NSString *)userID completion:(nullable TWTRNetworkingPipelineCallback)callback; |
|
51 |
|
|
52 |
/* |
|
53 |
Create a copy of current package instance with attemptCounter being added by one. current package object remain unchanged. |
|
54 |
*/ |
|
55 |
- (instancetype)copyForRetry; |
|
56 |
|
|
57 |
- (instancetype)init NS_UNAVAILABLE; |
|
58 |
|
|
59 |
@end |
|
60 |
|
|
61 |
NS_ASSUME_NONNULL_END |