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

Add priority configuration #71

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

albertchae
Copy link
Collaborator

Summary

run is marked as optional in the SDK spec and in the JS SDK, but this
means we could call with an empty priority which seems a bit weird, so
I made it required here.

This seems difficult to write a reliable integration test and it looks
like it was skipped in the other SDKs as well

One possible test scenario we can try in a follow up, in combination
with throttling

  • 2 functions, fun_2 is higher priority than fun_1, they are throttled on the same key
  • call fun_1, fun_1, fun_2 in that order
  • check after the first execution of fun_1, that fun_2 got executed next
    before the second execution of fun_2

Checklist

  • Update documentation
  • Added unit/integration tests

Related

Copy link

linear bot commented Sep 3, 2024

@albertchae albertchae force-pushed the albert/inn-3334-priority-configuration branch from 11da0db to 804932d Compare September 3, 2024 11:33
@albertchae albertchae marked this pull request as ready for review September 6, 2024 06:33
@darwin67
Copy link
Contributor

darwin67 commented Sep 6, 2024

Here's an example with priority test in the core repo.
Though it might be a little hard to replicate in other languages.

https://github.com/inngest/inngest/blob/main/tests/golang/priority_test.go

`run` is marked as optional in the SDK spec and in the JS SDK, but this
means we could call with an empty `priority` which seems a bit weird, so
I made it required here.

This seems difficult to write a reliable integration test and it looks
like it was skipped in the other SDKs as well
- inngest/inngest-py#114
- inngest/inngest-js#362

One possible test scenario we can try in a follow up, in combination
with throttling
- 2 functions, fun_2 is higher priority than fun_1, they are throttled on the same key
- call fun_1, fun_1, fun_2 in that order
- check after the first execution of fun_1, that fun_2 got executed next
  before the second execution of fun_2
@albertchae albertchae force-pushed the albert/inn-3334-priority-configuration branch from 804932d to 5139c50 Compare September 6, 2024 14:22
@albertchae
Copy link
Collaborator Author

Here's an example with priority test in the core repo. Though it might be a little hard to replicate in other languages.

https://github.com/inngest/inngest/blob/main/tests/golang/priority_test.go

cool I think we can try this. I'll merge PR as is and follow up with a test if it works

@albertchae albertchae merged commit d8a7958 into main Sep 6, 2024
9 checks passed
@albertchae albertchae deleted the albert/inn-3334-priority-configuration branch September 6, 2024 14:29
@albertchae albertchae mentioned this pull request Sep 9, 2024
2 tasks
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.

3 participants