Giter Site home page Giter Site logo

husseinhj / timerhjqueue Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 25 KB

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

License: Other

Objective-C 93.80% Ruby 6.20%
queue timer-queue ios-queue objective-c-queue pick-periodic swift-queue

timerhjqueue's Introduction

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.

timerhjqueue's People

Contributors

husseinhj avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.