forked from eczarny/xmlrpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXMLRPCClient.h
42 lines (29 loc) · 1.17 KB
/
XMLRPCClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import <Foundation/Foundation.h>
#import "XMLRPCClientDelegate.h"
@class XMLRPCRequest, XMLRPCResponse;
@protocol XMLRPCClientTransportOperation;
@protocol XMLRPCClientTransport <NSObject>
@required
- (NSOperation<XMLRPCClientTransportOperation>*)sendRequest:(XMLRPCRequest*)request delegate: (id<XMLRPCClientDelegate>)delegate;
@optional
- (BOOL)supportsConcurrentRequests;
@end
@protocol XMLRPCClientTransportOperation <NSObject>
- (XMLRPCResponse*)response;
- (NSError*)error;
@end
typedef void (^RPCCompletion)(XMLRPCResponse*);
typedef void (^RPCError)(NSError*);
@interface XMLRPCClient : NSObject
- (id)initWithURL:(NSURL*)url;
- (id)initWithTransport: (id<XMLRPCClientTransport>)transport;
#pragma mark -
@property (nonatomic, assign) id<XMLRPCClientDelegate> delegate;
#pragma mark -
// Start an asynchronous request
- (NSOperation*)startRequest:(XMLRPCRequest*)request completion:(RPCCompletion)completion error:(RPCError)error;
// Perform a synchronous request
- (XMLRPCResponse*)performRequest:(XMLRPCRequest*)request error:(NSError**)error;
@property (nonatomic, assign) NSInteger maximumConcurrentRequests;
@property (nonatomic, assign) NSTimeInterval timeout;
@end