Comments (3)
In version 5 we changed the architecture to allow custom constraint. Information such as UUID are now owned by the constraint itself. The contraint is also registered only if necessary. Previously all constraint was registered for all the job which makes it inefficient.
https://github.com/lucas34/SwiftQueue/blob/master/Sources/SwiftQueue/Constraint%2BUniqueUUID.swift#L28
Would be possible to build a method to expose the UUID.
from swiftqueue.
I see. Thanks for letting me know. I'm a bit confused by the best approach for cancelling an individual job in the new version but for now I've got it working by:
- Generating a UUID before creating a job
- Adding this both as a parameter to the job (under the
.with
and as the ID for the.singleInstance
constraint - To cancel the job, I then get the UUID from the parameter and cancel with the
.cancelOperations(uuid: ...)
method
This works although it feels pretty clunky to me since the UUID is basically duplicated and I have to remember to include it as a parameter on job creation, otherwise there is no way to cancel it. I just can't see a better method since the UUID is otherwise not exposed anywhere so far as I can tell.
from swiftqueue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from swiftqueue.
Related Issues (20)
- Last persisted job appears to run twice (before and after app restart) HOT 5
- Possibility of running N concurrent jobs inside a queue HOT 2
- WatchOS support HOT 2
- Periodic run just once HOT 2
- EXC_BAD_ACCESS in the method createQueue HOT 4
- The waitUntilAllOperationsAreFinished method is called before completion HOT 2
- Not able to access registerForBackgroundTask method in SwiftQueueManager+BackgroundTask HOT 2
- <compiler-generated> SwiftQueueManager.enqueue(info:) HOT 3
- Support NSOperation Dependency HOT 2
- Crash when enqueue from multiples thread HOT 5
- <compiler-generated> SwiftQueueManager.enqueue(info:) #408 HOT 1
- Is it possible to start Foreground initiated jobs that continue background execution? HOT 2
- Replace Reachability dependency with NWPathMonitor usage HOT 4
- Get additional info for a job HOT 10
- extensible DefaultConstraintMaker for persist-able queue manager HOT 1
- Flaky test HOT 1
- Multiple Parallel Periodic jobs do not run in parallel HOT 2
- Can't persist jobs, Thread 1: "Invalid type in JSON write (__SwiftValue)" HOT 3
- A random crash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftqueue.