-
Notifications
You must be signed in to change notification settings - Fork 43
Bump target to iOS7, introduce nullability, always async, and separate storage from queue #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gelosi
wants to merge
14
commits into
thisandagain:master
Choose a base branch
from
gelosi:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6f779a5
🍋 sanitise code
gelosi 9d08d34
upgraded project to the more-less modern state (iOS 7 bottomline)
gelosi 9adb89e
Introduced Persistent Storage Injection for Queue
gelosi 63a2f12
added NSDictionary contents enforcements
gelosi 9673f1a
Refactoring part one: removing unnecessary for public use properties …
gelosi 1f2c92a
Renamed EDQueueStoredJob to EDQueueStorageItem which is way more logical
gelosi bd34c48
Refeactor stage two: code Task becomes Tag
gelosi 068d114
Refactoring: tune things up in line with merge request #22
gelosi 474a202
EDQueueJob got expiration date, maxRetryCount, retryTimeInterval; EDQ…
gelosi 82a64aa
Removes expired jobs along with removing job by ID
gelosi 12e0b86
Queue got jobCount & better scheduling though storage requirement (`f…
gelosi 22aac2c
fixed issue with global dispatch queue (so, each instance if EDQueue …
gelosi 29f231c
Interface refactoring: removed nullability from attempts property of …
gelosi 7e25335
StorageEngine: use more powerful NSKeyedArchiver (allows to store you…
gelosi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'EDQueue' | ||
s.version = '0.7.1' | ||
s.version = '1.1' | ||
s.license = 'MIT' | ||
s.summary = 'A persistent background job queue for iOS.' | ||
s.homepage = 'https://github.com/thisandagain/queue' | ||
s.authors = {'Andrew Sliwinski' => '[email protected]', 'Francois Lambert' => '[email protected]'} | ||
s.source = { :git => 'https://github.com/thisandagain/queue.git', :tag => 'v0.7.1' } | ||
s.platform = :ios, '5.0' | ||
s.homepage = 'https://github.com/gelosi/queue' | ||
s.authors = {'Andrew Sliwinski' => '[email protected]', 'Francois Lambert' => '[email protected]', 'Oleg Shanyuk' => '[email protected]'} | ||
s.source = { :git => 'https://github.com/gelosi/queue.git', :tag => 'v1.1' } | ||
s.platform = :ios, '7.0' | ||
s.source_files = 'EDQueue' | ||
s.library = 'sqlite3.0' | ||
s.requires_arc = true | ||
s.dependency 'FMDB', '~> 2.0' | ||
s.dependency 'FMDB', '~> 2.1' | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,12 @@ | |
// Copyright (c) 2012 Andrew Sliwinski. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
@import Foundation; | ||
|
||
#import "EDQueueJob.h" | ||
#import "EDQueuePersistentStorageProtocol.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(NSInteger, EDQueueResult) { | ||
EDQueueResultSuccess = 0, | ||
|
@@ -22,30 +27,42 @@ extern NSString *const EDQueueJobDidSucceed; | |
extern NSString *const EDQueueJobDidFail; | ||
extern NSString *const EDQueueDidDrain; | ||
|
||
@protocol EDQueueDelegate; | ||
@interface EDQueue : NSObject | ||
@class EDQueue; | ||
|
||
+ (EDQueue *)sharedInstance; | ||
@protocol EDQueueDelegate <NSObject> | ||
- (void)queue:(EDQueue *)queue processJob:(EDQueueJob *)job completion:(EDQueueCompletionBlock)block; | ||
@end | ||
|
||
@interface EDQueue : NSObject | ||
|
||
@property (nonatomic, weak) id<EDQueueDelegate> delegate; | ||
@property (nonatomic, strong, readonly) id<EDQueuePersistentStorage> storage; | ||
|
||
/** | ||
* Returns true if Queue is running (e.g. not stopped). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Thanks |
||
*/ | ||
@property (nonatomic, readonly) BOOL isRunning; | ||
/** | ||
* Returns true if Queue is performing Job right now | ||
*/ | ||
@property (nonatomic, readonly) BOOL isActive; | ||
@property (nonatomic) NSUInteger retryLimit; | ||
|
||
- (void)enqueueWithData:(id)data forTask:(NSString *)task; | ||
+ (instancetype)defaultQueue; | ||
|
||
- (instancetype)initWithPersistentStore:(id<EDQueuePersistentStorage>)persistentStore; | ||
|
||
- (void)enqueueJob:(EDQueueJob *)job; | ||
- (void)start; | ||
- (void)stop; | ||
- (void)empty; | ||
|
||
- (BOOL)jobExistsForTask:(NSString *)task; | ||
- (BOOL)jobIsActiveForTask:(NSString *)task; | ||
- (NSDictionary *)nextJobForTask:(NSString *)task; | ||
- (NSInteger)jobCount; | ||
|
||
@end | ||
- (BOOL)jobExistsForTag:(NSString *)tag; | ||
- (BOOL)jobIsActiveForTag:(NSString *)tag; | ||
- (nullable EDQueueJob *)nextJobForTag:(NSString *)tag; | ||
|
||
@protocol EDQueueDelegate <NSObject> | ||
@optional | ||
- (EDQueueResult)queue:(EDQueue *)queue processJob:(NSDictionary *)job; | ||
- (void)queue:(EDQueue *)queue processJob:(NSDictionary *)job completion:(EDQueueCompletionBlock)block; | ||
@end | ||
|
||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we move the location of the homepage and repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've set it to mine now to use it already, but if you will accept the changes in the end (I'm still on it) I'd be happy to keep original link to repo.