Skip to content

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

License

Notifications You must be signed in to change notification settings

Husseinhj/TimerHJQueue

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published