Feature/priorities
We needed the option to enqueue tasks with priorities. This is a first shot at it. Let me know what you think.
- Also fixes obsolete imports in the README.
First step towards https://github.com/rknell/dart_queue/issues/3
And one question: Some tests were running very flaky on my machine, namely it should handle an error correctly (also testing oncomplete) fails from time to time with this error message:
00:32 +5 -1: Queue it should handle an error correctly (also testing oncomplete) [E]
TimeoutException after 0:00:30.000000: Test timed out after 30 seconds. See https://pub.dev/packages/test#timeouts
dart:isolate _RawReceivePortImpl._handleMessage
Any idea? I am on latest macOS 11.2.1 and this is my flutter doctor:
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.1 20D74 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.54.1)
[✓] Connected device (2 available)
hey @hffmnn I just wanted to touch base with you and let you know I have noticed the pull requests coming in!
I just haven't had a chance to really play with it yet - I use queue very heavily in one of my main projects right now so its going to come up, I have just not touched that part of it for a couple of weeks.
On the flakyness - not sure. But that is something worth looking into. If its timing out, especially on that test, then there is a chance the error isn't being caught and the promise is never returning, thereby never freeing that slot in the queue. Could be a major issue! I'm very happy to have a look at it though
@rknell Any chance this PR will be looked at again? I think the priority option is an important feature.
@victorshx its not dead, but there are some conflicts that need to be resolved as you can see and I just haven't been digging around the code much lately as I've been on other projects. Queue is used by a lot of other projects in the backend and its very stable so I'm happy for it to be a slow moving beast, but yes, priorities will land at some point.
It would be great if priority would not be true/false, but an integer, so different priority levels are possible
This package has been outstanding. This feature would be very welcome (if this package is still considered maintained). Thank you