mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/MtProtoKit git-subtree-mainline: 3b155750f5a4894ff3dedf1860a37e94e0ea9571 git-subtree-split: 14ab734b977fd4f1686a2a13415f6a4c9b9fdd6d
63 lines
1.6 KiB
Objective-C
63 lines
1.6 KiB
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
#import "MTSubscriber.h"
|
|
|
|
@class MTQueue;
|
|
|
|
@interface MTSignal : NSObject
|
|
{
|
|
@public
|
|
id<MTDisposable> (^_generator)(MTSubscriber *);
|
|
}
|
|
|
|
- (instancetype)initWithGenerator:(id<MTDisposable> (^)(MTSubscriber *))generator;
|
|
|
|
- (id<MTDisposable>)startWithNext:(void (^)(id next))next error:(void (^)(id error))error completed:(void (^)())completed;
|
|
- (id<MTDisposable>)startWithNext:(void (^)(id next))next;
|
|
- (id<MTDisposable>)startWithNext:(void (^)(id next))next completed:(void (^)())completed;
|
|
|
|
+ (MTSignal *)single:(id)next;
|
|
+ (MTSignal *)fail:(id)error;
|
|
+ (MTSignal *)never;
|
|
+ (MTSignal *)complete;
|
|
|
|
- (MTSignal *)then:(MTSignal *)signal;
|
|
|
|
- (MTSignal *)delay:(NSTimeInterval)seconds onQueue:(MTQueue *)queue;
|
|
- (MTSignal *)timeout:(NSTimeInterval)seconds onQueue:(MTQueue *)queue orSignal:(MTSignal *)signal;
|
|
|
|
- (MTSignal *)catch:(MTSignal *(^)(id error))f;
|
|
|
|
+ (MTSignal *)mergeSignals:(NSArray *)signals;
|
|
+ (MTSignal *)combineSignals:(NSArray *)signals;
|
|
|
|
- (MTSignal *)restart;
|
|
|
|
- (MTSignal *)take:(NSUInteger)count;
|
|
|
|
- (MTSignal *)switchToLatest;
|
|
|
|
- (MTSignal *)map:(id (^)(id))f;
|
|
- (MTSignal *)filter:(bool (^)(id))f;
|
|
- (MTSignal *)mapToSignal:(MTSignal *(^)(id))f;
|
|
|
|
- (MTSignal *)onDispose:(void (^)())f;
|
|
|
|
- (MTSignal *)deliverOn:(MTQueue *)queue;
|
|
- (MTSignal *)startOn:(MTQueue *)queue;
|
|
|
|
- (MTSignal *)takeLast;
|
|
|
|
- (MTSignal *)reduceLeft:(id)value with:(id (^)(id, id))f;
|
|
|
|
@end
|
|
|
|
@interface MTPipe : NSObject
|
|
|
|
@property (nonatomic, copy, readonly) MTSignal *(^signalProducer)();
|
|
@property (nonatomic, copy, readonly) void (^sink)(id);
|
|
|
|
- (instancetype)initWithReplay:(bool)replay;
|
|
|
|
@end
|