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

Make IInstantJobRegistry members return the job correlation id #153

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

nulltoken
Copy link
Collaborator

@nulltoken nulltoken commented Jan 2, 2025

Pull request description

Very first step toward #147 and #36.

Rationale:
In order for the consumer to later be able to poll for (or be notified of) the progress of an orchestration run, getting the correlation id early should be beneficial.

PR meta checklist

  • Pull request is targeted at main branch for code
  • Pull request is linked to all related issues, if any.

Code PR specific checklist

  • My code follows the code style of this project and AspNetCore coding guidelines.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have updated the appropriate sub section in the CHANGELOG.md.
  • I have added, updated or removed tests to according to my changes.
    • All tests passed.

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/NCronJob/Registry/IInstantJobRegistry.cs 87.50% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/NCronJob/Registry/IInstantJobRegistry.cs 91.48% <87.50%> (+0.92%) ⬆️

@nulltoken nulltoken requested a review from linkdotnet January 2, 2025 10:49
@linkdotnet
Copy link
Member

I am currently on mobile, will check the whole or later.

my Thought (without checking code) might be to expose the IJobContext where there is already the Id. But that might result in a whole bunch of other pitfalls

@nulltoken
Copy link
Collaborator Author

my Thought (without checking code) might be to expose the IJobContext where there is already the Id. But that might result in a whole bunch of other pitfalls

It's not available yet. It's created later, few layers down, by the JobExecutor.

Besides, only "forced" instant jobs may actually be able to easily return it; the queuing indirection would make it especially complex to directly return it from IInstantJobRegistry members.

@linkdotnet
Copy link
Member

my Thought (without checking code) might be to expose the IJobContext where there is already the Id. But that might result in a whole bunch of other pitfalls

It's not available yet. It's created later, few layers down, by the JobExecutor.

Besides, only "forced" instant jobs may actually be able to easily return it; the queuing indirection would make it especially complex to directly return it from IInstantJobRegistry members.

Oh yeah - that is obviously true. It would be more of a Task<IJobExecutionContext> - but I don't see much use in that at the moment.

@linkdotnet
Copy link
Member

With all those new changes I would make a new release (stable 4.1.0) - does that fit for you?

@nulltoken nulltoken merged commit 7334b45 into main Jan 2, 2025
3 of 4 checks passed
@nulltoken nulltoken deleted the ntk/instant_return branch January 2, 2025 18:20
@nulltoken
Copy link
Collaborator Author

With all those new changes I would make a new release (stable 4.1.0) - does that fit for you?

@linkdotnet I'd love that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants