Skip to content
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

Adding GetFirstByLowestScoreFromSet overload #1251

Merged
merged 9 commits into from Jan 15, 2019
Merged

Adding GetFirstByLowestScoreFromSet overload #1251

merged 9 commits into from Jan 15, 2019

Conversation

cdschneider
Copy link
Contributor

First step in improving performance of DelayedJobScheduler background process, as mentioned in #38. This is also listed in the Hangfire 1.7.0 roadmap.

The next step following this feature is to implement batch state transitions for the batch of retrieved jobs to be scheduled.

@burningice2866
Copy link
Contributor

Won't this break existing 3rd party storage connection implementations due to the new method on the interface?

By introducing the new overload only in an abstract class, and making it virtual, we are removing breaking changes, making the implementation optional. So all the current storages will be compatible with these changes.
Just to use the same words as in other places like IMonitoringApi.
Since ArgumentException can be originated from different parameters, we also need to check the actual parameter that caused an exception.
The result is an ordered collection, and that order is based on `score` rather than on the value itself. Since HashSet can't preserve that type of ordering, we are using List instead.
@odinserj
Copy link
Member

Thanks @cdschneider for implementing this and writing tests! I've removed breaking changes as proposed by @burningice2866 (nice catch!) and did some cosmetic changes. Now waiting on CI results and merging it as soon as they are ready.

I've also did some tests using this new method and rewritten DelayedJobScheduler, and seen up to 70% better throughput when using delayed jobs using SQL Server.

@HangfireIO HangfireIO deleted a comment from codecov-io Jan 15, 2019
@odinserj odinserj merged commit 3833831 into HangfireIO:dev Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants