1 | // Copyright 2018-present 650 Industries. All rights reserved.
|
2 |
|
3 | #import <EXTaskManager/EXTask.h>
|
4 |
|
5 | @implementation EXTask
|
6 |
|
7 | - (instancetype)initWithName:(nonnull NSString *)name
|
8 | appId:(nonnull NSString *)appId
|
9 | appUrl:(nonnull NSString *)appUrl
|
10 | consumerClass:(Class)consumerClass
|
11 | options:(nullable NSDictionary *)options
|
12 | delegate:(nullable id<EXTaskDelegate>)delegate
|
13 | {
|
14 | if (self = [super init]) {
|
15 | _name = name;
|
16 | _appId = appId;
|
17 | _appUrl = appUrl;
|
18 | _consumer = [consumerClass new];
|
19 | _options = options;
|
20 | _delegate = delegate;
|
21 | }
|
22 | return self;
|
23 | }
|
24 |
|
25 | - (void)executeWithData:(nullable NSDictionary *)data withError:(nullable NSError *)error
|
26 | {
|
27 | [_delegate executeTask:self withData:data withError:error];
|
28 | }
|
29 |
|
30 | @end
|