Skip to content

Feat/dynamic queue with concurrency#973

Open
pcmid wants to merge 4 commits intohibiken:masterfrom
pcmid:feat/dynamic_queue_with_concurrency
Open

Feat/dynamic queue with concurrency#973
pcmid wants to merge 4 commits intohibiken:masterfrom
pcmid:feat/dynamic_queue_with_concurrency

Conversation

@pcmid
Copy link
Copy Markdown

@pcmid pcmid commented Nov 20, 2024

Implemented #250, based on #879, cc @kanzihuang, with support for dynamically adding queues and controlling concurrency levels.

Not fully verified, but it works perfectly for my use case: a distributed spider with concurrency control.

Known issues:

  • We need a global lock to protect the server’s restart operation.
  • When the server is running, setting the queue concurrency does not take effect.

@pcmid pcmid force-pushed the feat/dynamic_queue_with_concurrency branch from 541a69a to 2bace4c Compare November 20, 2024 17:24
@pcmid pcmid changed the title Feat/dynamic queue with concurrency WIP: Feat/dynamic queue with concurrency Nov 20, 2024
@pcmid pcmid changed the title WIP: Feat/dynamic queue with concurrency Feat/dynamic queue with concurrency Nov 20, 2024
@hamidrabedi
Copy link
Copy Markdown

any updates on this? where are we right now?

@kamikazechaser
Copy link
Copy Markdown
Collaborator

kamikazechaser commented Dec 3, 2024

Not fully verified

This is a major feature. It could land on a testing branch for a few months before we release it on master just to smoke out any bugs. Also see the comments left by the linter. It would be good to also have feedback from @kanzihuang (if he is around).

@pcmid
Copy link
Copy Markdown
Author

pcmid commented Jan 16, 2025

@kamikazechaser I recently retested this PR, and the results were perfect with no other issues. I believe it’s ready to be merged into the testing branch.

@nett32
Copy link
Copy Markdown

nett32 commented Aug 6, 2025

Any updates on this issue?

1 similar comment
@GongchuangSu
Copy link
Copy Markdown

Any updates on this issue?

// channel to communicate back to the long running "processor" goroutine.
// once is used to send value to the channel only once.
done chan struct{}
once sync.Once
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd keep the original pattern for consistency (also used in Lease struct). Nothing against explicit initialization of the object.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This change provides the ability to reset later by assigning a new *sync.Once.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh, I just realized my mistake — it's assignment, not copying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants