Husseinhj / TimerHJQueue

This is a simple queue with Infinite or limit length and also dequeue periodic with timer for iOS platforms Edit Add topics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TimerHJQueue build pod version li CocoaPods CocoaPods

This is a simple queue with Infinite or limit length and also dequeue periodic with timer for iOS platforms Edit Add topics

Usage


HJQueue queue = [[HJQueue alloc] initInfiniteLength];
[queue setDelegate:self];

queue :

[queue enqueue:@(++_counter)]

dequeue :

NSString *obj = [queue dequeue];

Time interval: interval is per second.

[queue setQueueTimeInterval:60];

Dequeue count: dequeue periodic with arrayOfObjects with set dequeueCount :

_queue.dequeueCount = 10;

delegate : dequeue just single object :

-(void) dequeueWithTick:(id)object{
    NSLog([NSString stringWithFormat:@"Dequeue periodic ('%.01f') with value : %@ \n",
           [queue queueTimeInterval],object]);
}

dequeue arrayOfObjects with set dequeueCount :

-(void) dequeueArrayWithTick:(NSArray<id> *)objects{
    NSString *message = @"";
    for (id object in objects) {
        message = [message stringByAppendingString:[NSString stringWithFormat:@"%@ \n",object]];
    }
    NSLog([NSString stringWithFormat:@"%@ Dequeue periodic ('%.01f') with value : %@ \n",_logTextView.text,[_queue queueTimeInterval],message]);
}

Installation


Add the following to your Podfile: Install from CocoaPod.

    pod 'TimerHJQueue', '~> 1.0.2'

Then run pod install.

About

This is a simple queue with Infinite or limit length and also dequeue periodic with timer for iOS platforms Edit Add topics

License:Other


Languages

Language:Objective-C 93.8%Language:Ruby 6.2%