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 concurrent option #10

Merged
merged 6 commits into from May 4, 2021
Merged

Add concurrent option #10

merged 6 commits into from May 4, 2021

Conversation

brendt
Copy link
Contributor

@brendt brendt commented May 4, 2021

No description provided.

@@ -29,6 +30,33 @@ public function it_will_execute_the_given_closures()
$this->assertEquals([2, 4], $results);
}

/** @test */
public function it_will_execute_the_given_closures_with_concurrency_cap()
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

src/Fork.php Outdated Show resolved Hide resolved
src/Fork.php Outdated

$output[$task->order()] = $taskOutput;
if (count($queue)) {
$i = array_key_first($queue);
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

src/Fork.php Outdated Show resolved Hide resolved
src/Fork.php Outdated Show resolved Hide resolved
Copy link
Member

@freekmurze freekmurze left a comment

Choose a reason for hiding this comment

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

Looks nice.

We could opt to extract some things in waitFor to their own functions so it's more clear what it happing there. If it would make it easier, I wouldn't made setting $running as an instance variable.

@brendt
Copy link
Contributor Author

brendt commented May 4, 2021

PHP cs is acting up, but I'm going to merge it nevertheless.

@brendt brendt closed this May 4, 2021
@brendt brendt reopened this May 4, 2021
@brendt
Copy link
Contributor Author

brendt commented May 4, 2021

wrong button ><

@brendt brendt merged commit eec2c6b into master May 4, 2021
@brendt brendt deleted the concurrent branch May 4, 2021 07:47
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.

None yet

2 participants