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

Detect already running execution for group_id #63

Merged
merged 7 commits into from
Nov 2, 2022

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Oct 24, 2022

Detect if an execution with a specific group id is already being executed. Using the :global registry should make this distributed as well. Raise an error in this case by now.
We can do different things with this error later on: stop current execution, requeue message...

Some refs on the name registration: https://hexdocs.pm/elixir/1.12/GenServer.html#module-name-registration
PD: Maybe there better solutions for this, but I had some fun learning the :global registry usage hehe

@arbulu89 arbulu89 marked this pull request as ready for review October 24, 2022 08:55
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple things then green light from me

lib/wanda/execution.ex Outdated Show resolved Hide resolved
lib/wanda/execution.ex Outdated Show resolved Hide resolved
Copy link
Member

@fabriziosestito fabriziosestito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A proposal on the name registration

lib/wanda/execution.ex Outdated Show resolved Hide resolved
Copy link
Member

@fabriziosestito fabriziosestito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick on error atom, but LGTM
happy when CI is

@arbulu89 arbulu89 force-pushed the detect-concurrent-execution branch 2 times, most recently from bbea5ee to a0ac8d0 Compare November 2, 2022 08:39
@arbulu89 arbulu89 dismissed dottorblaster’s stale review November 2, 2022 13:08

All the requested changes have been addressesd

@arbulu89 arbulu89 merged commit a10f186 into main Nov 2, 2022
@arbulu89 arbulu89 deleted the detect-concurrent-execution branch November 2, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants