mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 14:02:48 +00:00
Initialise channel with persistence and context
This commit is contained in:
parent
ca405da200
commit
c88249d3be
@ -36,15 +36,15 @@
|
||||
@class BITOrderedDictionary;
|
||||
@class BITConfiguration;
|
||||
@class BITTelemetryData;
|
||||
|
||||
@class BITTelemetryContext;
|
||||
@class BITPersistence;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface BITChannel : NSObject
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Queue management
|
||||
///-----------------------------------------------------------------------------
|
||||
@property (nonatomic, strong) BITTelemetryContext *telemetryContext;
|
||||
|
||||
@property (nonatomic, strong) BITPersistence *persistence;
|
||||
/**
|
||||
* A queue which makes array operations thread safe.
|
||||
*/
|
||||
@ -55,6 +55,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
@property (nonatomic, assign) NSUInteger dataItemCount;
|
||||
|
||||
/**
|
||||
* A timer source which is used to flush the queue after a cretain time.
|
||||
*/
|
||||
@property (nonatomic, strong, null_unspecified) dispatch_source_t timerSource;
|
||||
|
||||
- (instancetype)initWithTelemetryContext:(BITTelemetryContext *)telemetryContext persistence:(BITPersistence *) persistence;
|
||||
|
||||
/**
|
||||
* Enqueue telemetry data (events, metrics, exceptions, traces) before processing it.
|
||||
*
|
||||
@ -67,10 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
- (void)persistDataItemQueue;
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name JSON Stream
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Adds the specified dictionary to the JSON Stream string.
|
||||
*
|
||||
@ -93,15 +96,6 @@ void bit_appendStringToSafeJsonStream(NSString *string, char *__nonnull*__nonnul
|
||||
*/
|
||||
void bit_resetSafeJsonStream(char *__nonnull*__nonnull jsonStream);
|
||||
|
||||
///-----------------------------------------------------------------------------
|
||||
/// @name Batching
|
||||
///-----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A timer source which is used to flush the queue after a cretain time.
|
||||
*/
|
||||
@property (nonatomic, strong, null_unspecified) dispatch_source_t timerSource;
|
||||
|
||||
/**
|
||||
* Starts the timer.
|
||||
*/
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#if HOCKEYSDK_FEATURE_TELEMETRY
|
||||
|
||||
#import "HockeySDK.h"
|
||||
#import "BITTelemetryContext.h"
|
||||
#import "BITTelemetryData.h"
|
||||
#import "HockeySDKPrivate.h"
|
||||
|
||||
@ -28,6 +29,14 @@ static BITChannel *_sharedChannel = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithTelemetryContext:(BITTelemetryContext *)telemetryContext persistence:(BITPersistence *) persistence {
|
||||
if(self = [self init]) {
|
||||
_telemetryContext = telemetryContext;
|
||||
_persistence = persistence;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Queue management
|
||||
|
||||
- (BOOL)isQueueBusy{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user