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 projection option constants to trigger pcntl_signal_dispatch #293

Merged
merged 8 commits into from
Jul 1, 2017
Merged

Add projection option constants to trigger pcntl_signal_dispatch #293

merged 8 commits into from
Jul 1, 2017

Conversation

fritz-gerneth
Copy link
Contributor

Moving these constants to the generic interface as discussed here . Will update the other PR with the new minimum version constraint once this has been merged and released as a new version.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.757% when pulling 0ef8fbc on funct:pcntl_config_constants into d7777b5 on prooph:master.

@prolic
Copy link
Member

prolic commented Jun 30, 2017

Same change is missing in ReadModelProjector interface.

Do you think it's worth adding this feature also to InMemoryEventStore?

@prolic prolic self-assigned this Jun 30, 2017
@prolic
Copy link
Member

prolic commented Jun 30, 2017

Travis failed.

@prolic
Copy link
Member

prolic commented Jun 30, 2017

1) ProophTest\EventStore\Projection\InMemoryEventStoreProjectorTest::it_throws_exception_when_unknown_event_store_instance_passed

Failed asserting that exception of type "TypeError" matches expected exception "Prooph\EventStore\Exception\InvalidArgumentException". Message was: "Argument 5 passed to Prooph\EventStore\Projection\InMemoryEventStoreProjector::__construct() must be of the type boolean, integer given, called in /home/travis/build/prooph/event-store/tests/Projection/InMemoryEventStoreProjectorTest.php on line 121" at

/home/travis/build/prooph/event-store/src/Projection/InMemoryEventStoreProjector.php:109

/home/travis/build/prooph/event-store/tests/Projection/InMemoryEventStoreProjectorTest.php:121

@fritz-gerneth
Copy link
Contributor Author

Not entirely sure why the test fails for travis. It's the same error I get over here too. If you have any idea what might be causes this .. :)

I thought about moving the tests to the abstract classes - but then we cannot profit from test inheritence like we do in the test files (let the extending class define the projection manager, setup is outsourced to the separate files instead).

@prolic
Copy link
Member

prolic commented Jun 30, 2017

some php-cs isses, and missing declare(strict_types=1);

@prolic
Copy link
Member

prolic commented Jun 30, 2017

Will review again tomorrow and I check the tests and what's going on with travis.

@prolic prolic merged commit 7227f94 into prooph:master Jul 1, 2017
@prolic
Copy link
Member

prolic commented Jul 1, 2017

@fritz-gerneth I fixed the tests and made some small changes. Please check this.

Why exec before the command?

From php.net:
Because the way proc_open() actually works on Unix/Linux is by starting "/bin/sh -c usercmd userargs...", e.g., "/bin/sh -c /usr/bin/compress /tmp/foo".[Note 1] That means normally your command is the child of the shell, so the pid you retrieve with proc_get_status() is the pid of the shell (PHP's child), and you have to fumble around trying to find the pid of your command (PHP's grandchild). But if you put "exec" in front of your command, you tell the shell to replace itself with your command without starting another process (technically, to exec your command without forking first). That means your command will inherit the pid of the shell, which is the pid that proc_get_status() returns.

@fritz-gerneth
Copy link
Contributor Author

I see, weird it worked on my Linux then :) (CentOs7). THanks for digging into this (y)

@fritz-gerneth fritz-gerneth deleted the pcntl_config_constants branch July 1, 2017 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants