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 support for workflow and activity queues #351

Merged
merged 32 commits into from
Jun 5, 2024
Merged

Add support for workflow and activity queues #351

merged 32 commits into from
Jun 5, 2024

Conversation

cschleiden
Copy link
Owner

@cschleiden cschleiden commented Jun 2, 2024

This PR introduces the option to have different queues for workflows and activities. For example,

workflow.ExecuteActivity[any](ctx, workflow.ActivityOptions{
	Queue: "custom",
}, MyActivity).Get(ctx)

will schedule the activity task for this activity on a custom queue. Only workers listening to the custom queue will see the task and work on it.

Remaining work:

  • Check query plans for the sql backend and adjust indexes
  • Add sample
  • Update diag UI
  • Update docs

Closes: #115

@cschleiden
Copy link
Owner Author

!bench !large

Copy link

github-actions bot commented Jun 3, 2024

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 158.6 ± 18.0 133.8 178.5 1.00
redis-pr 193.3 ± 23.3 153.8 259.5 1.22 ± 0.20

Large MySQL payload run (1MB)

Command Mean [s] Min [s] Max [s] Relative
mysql-main 24.314 ± 1.450 22.745 27.836 1.02 ± 0.07
mysql-pr 23.933 ± 0.691 23.013 25.016 1.00

Large SQLite payload run (1MB)

Command Mean [s] Min [s] Max [s] Relative
sqlite-main 22.167 ± 0.720 20.974 23.102 1.01 ± 0.05
sqlite-pr 21.922 ± 0.761 21.112 22.967 1.00

Large Redis payload run (1MB)

Command Mean [s] Min [s] Max [s] Relative
redis-main 20.808 ± 0.858 19.723 21.773 1.00
redis-pr 21.007 ± 0.821 19.799 21.945 1.01 ± 0.06

@cschleiden
Copy link
Owner Author

!bench !large

@cschleiden
Copy link
Owner Author

!bench

Copy link

github-actions bot commented Jun 4, 2024

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 143.2 ± 19.7 121.2 176.1 1.00
redis-pr 184.4 ± 35.8 129.7 252.8 1.29 ± 0.31

@cschleiden
Copy link
Owner Author

!bench

Copy link

github-actions bot commented Jun 4, 2024

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 150.2 ± 20.3 124.3 176.8 1.00
redis-pr 198.1 ± 27.8 152.8 258.3 1.32 ± 0.26

@cschleiden
Copy link
Owner Author

!bench

Copy link

github-actions bot commented Jun 5, 2024

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 280.1 ± 56.1 202.2 399.7 1.00
redis-pr 313.5 ± 75.2 175.9 432.4 1.12 ± 0.35

@cschleiden
Copy link
Owner Author

!bench

Copy link

github-actions bot commented Jun 5, 2024

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 138.8 ± 17.8 120.1 189.9 1.00
redis-pr 167.2 ± 20.7 120.4 189.7 1.21 ± 0.21

@cschleiden cschleiden marked this pull request as ready for review June 5, 2024 05:25
@cschleiden
Copy link
Owner Author

!bench

Copy link

github-actions bot commented Jun 5, 2024

MySQL run

Command Mean [ms] Min [ms] Max [ms] Relative
mysql-main 547.2 ± 147.0 422.7 920.9 1.07 ± 0.30
mysql-pr 510.9 ± 42.9 463.2 566.6 1.00

SQLite run

Command Mean [ms] Min [ms] Max [ms] Relative
sqlite-main 847.8 ± 108.3 586.8 917.2 1.29 ± 0.32
sqlite-pr 657.0 ± 138.4 475.2 873.5 1.00

Redis run

Command Mean [ms] Min [ms] Max [ms] Relative
redis-main 168.1 ± 28.1 133.9 247.8 1.00
redis-pr 208.1 ± 24.8 174.0 253.1 1.24 ± 0.25

@cschleiden cschleiden merged commit c798be9 into main Jun 5, 2024
4 checks passed
@cschleiden cschleiden deleted the queues branch June 5, 2024 05:29
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.

Support different activity queues
1 participant