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 Config and Migration plus review changes #13

Merged
merged 19 commits into from
Apr 3, 2024
Merged

Conversation

aphraoh
Copy link
Contributor

@aphraoh aphraoh commented Apr 2, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️

@aphraoh aphraoh closed this Apr 2, 2024
@aphraoh aphraoh reopened this Apr 2, 2024
@aphraoh aphraoh closed this Apr 2, 2024
@aphraoh aphraoh reopened this Apr 2, 2024
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (0a408ed) to head (c2b137c).

Files Patch % Lines
src/Adapter.php 0.00% 18 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             master     #13   +/-   ##
========================================
  Coverage      0.00%   0.00%           
- Complexity       22      26    +4     
========================================
  Files             1       1           
  Lines            84      95   +11     
========================================
- Misses           84      95   +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aphraoh aphraoh closed this Apr 2, 2024
@aphraoh aphraoh reopened this Apr 2, 2024
aphraoh added 2 commits April 2, 2024 14:15
@aphraoh aphraoh closed this Apr 2, 2024
@aphraoh aphraoh reopened this Apr 2, 2024
@aphraoh
Copy link
Contributor Author

aphraoh commented Apr 2, 2024

Hi @vjik and @xepozz us requested except...

  1. @xepozz Did not put "yiisoft/db-migration" to "suggested" section in composer.json as breaks build, please can we deal with this in another pull request.
  2. @vjik not remove the empty di as this also cause problems (can not exactly remember what they were), please can we deal with this in another pull request.

config/di.php Outdated Show resolved Hide resolved
src/Adapter.php Outdated Show resolved Hide resolved
@@ -92,7 +97,7 @@ public function push(MessageInterface $message): MessageInterface

public function subscribe(callable $handlerCallback): void
{
$this->runExisting($handlerCallback);
$this->run($handlerCallback, true, 5); // TWK TODO timeout should not be hard coded
Copy link
Member

Choose a reason for hiding this comment

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

Do you plan to resolve it before merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I do it after the merge, I believe the solution should be somewhere in the middleware but need to investigate a bit further so maybe that can be a lession for another day after the merge...

// TWK TODO ??? if (!$this->mutex->acquire(__CLASS__ . $this->channel, $this->mutexTimeout)) {
// TWK TODO ??? throw new \Exception('Has not waited the lock.');
// TWK TODO ??? }
// TWK TODO what is useMaster in Yii3 return $this->db->useMaster(function () {
Copy link
Member

Choose a reason for hiding this comment

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

src/Adapter.php Outdated
{
while ($this->loop->canContinue()) {
if ($payload = $this->reserve()) {
if ($handlerCallback(\unserialize($payload['job']))) {
Copy link
Member

Choose a reason for hiding this comment

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

In general, we're not using PHP serialization for queue. Is it necessary?

src/Adapter.php Outdated
{
while ($this->loop->canContinue()) {
if ($payload = $this->reserve()) {
if ($handlerCallback(\unserialize($payload['job']))) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, will use this interface

@xepozz
Copy link
Member

xepozz commented Apr 3, 2024

@aphraoh Do not remove discussions, do not use force-push, just add commits one by one, do not care about the rest.

As I wrote before, I don't like yiisoft/db-migration and yiisoft/mutex in require section. If the second is used in the adapter, then first is just declared one files with sql and it maybe useless.

Move it to suggests composer section.

@samdark
Copy link
Member

samdark commented Apr 3, 2024

just add commits one by one, do not care about the rest.

Yes. We take care about squashing commits when merging, but we need to see how it progressed while doing review. Also, force-pushing is quite confusing for GitHub UI.

aphraoh and others added 2 commits April 3, 2024 15:19
Start description with capital letter and end with dot.

Co-authored-by: Alexander Makarov <[email protected]>
@aphraoh
Copy link
Contributor Author

aphraoh commented Apr 3, 2024

just add commits one by one, do not care about the rest.

Yes. We take care about squashing commits when merging, but we need to see how it progressed while doing review. Also, force-pushing is quite confusing for GitHub UI.

Oh dear, please send me a link to the process I should following if I would like to ammend a pull request in github :-|

aphraoh added 3 commits April 3, 2024 15:56
Update var comments to convention
Use serialize interface instead of php serialise
@aphraoh aphraoh closed this Apr 3, 2024
@aphraoh aphraoh reopened this Apr 3, 2024
@aphraoh
Copy link
Contributor Author

aphraoh commented Apr 3, 2024

Hi @xepozz @samdark @vjik , hopefully we can merge with the following outstanding...

  1. // TWK TODO timeout should not be hard coded
  2. // TWK TODO what is useMaster in Yii3
  3. @xepozz, have removed yiisoft/db-migration from composer.json, but yiisoft/mutex still in required section cause used in Adopter (see constructor)

@aphraoh
Copy link
Contributor Author

aphraoh commented Apr 3, 2024

Apologies in advance if I have done any squeezed and forced commits, still googling to see exactly what you mean by that...

@samdark
Copy link
Member

samdark commented Apr 3, 2024

@aphraoh latest commits are fine.

@samdark samdark merged commit 707c126 into yiisoft:master Apr 3, 2024
26 of 30 checks passed
@samdark
Copy link
Member

samdark commented Apr 3, 2024

Let's merge it and address comments separately. Good job, @aphraoh.

@aphraoh
Copy link
Contributor Author

aphraoh commented Apr 4, 2024 via email

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