GithubHelp home page GithubHelp logo

prooph / standard-projections Goto Github PK

View Code? Open in Web Editor NEW
15.0 6.0 4.0 97 KB

Standard projections to use with Prooph EventStore

Home Page: http://getprooph.org/

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
prooph php event-store projections ddd cqrs

standard-projections's Introduction

Standard Projections for Prooph EventStore

Continuous Integration Coverage Status Gitter

Overview

The standard projections are some kind of event-indexing, so you can retrieve events from all streams at once (AllStreamProjectionRunner), by category (CategoryStreamProjectionRunner) or by message name (MessageNameStreamProjectionRunner). See docs for more information.

Requirements

  • PHP >= 7.4
  • Prooph EventStore v7

Documentation

Documentation is in the doc tree, and can be compiled using bookdown.

$ php ./vendor/bin/bookdown docs/bookdown.json
$ php -S 0.0.0.0:8080 -t docs/html/

Then browse to http://localhost:8080/

Support

Contribute

Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License

Released under the New BSD License.

standard-projections's People

Contributors

basz avatar codeliner avatar mikemilano avatar prolic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

standard-projections's Issues

Standard ReadModels

How already proposed in chat, what about standard read models in this package?
e.g. MongoDB, ElasticSearch, Memcache and Redis should almost be the same and easy to implement.

test won't run Fatal error: Class 'ProophTest\EventStore\Mock\TestDomainEvent' not found

git clone https://github.com/prooph/standard-projections.git
cd standard-projections/
composer install
vendor/bin/phpunit


PHPUnit 6.5.6 by Sebastian Bergmann and contributors.

EEPHP Fatal error:  Class 'ProophTest\EventStore\Mock\TestDomainEvent' not found in /Users/bas/standard-projections/tests/Mock/TestDomainEvent.php on line 15
PHP Stack trace:
PHP   1. {main}() /Users/bas/standard-projections/vendor/phpunit/phpunit/phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() /Users/bas/standard-projections/vendor/phpunit/phpunit/phpunit:53
PHP   3. PHPUnit\TextUI\Command->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/Command.php:148
PHP   4. PHPUnit\TextUI\TestRunner->doRun() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/Command.php:195
PHP   5. PHPUnit\Framework\TestSuite->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:546
PHP   6. PHPUnit\Framework\TestSuite->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestSuite.php:755
PHP   7. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestSuite.php:755
PHP   8. PHPUnit\Framework\TestResult->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:894
PHP   9. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->runBare() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestResult.php:698
PHP  10. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->runTest() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:939
PHP  11. ReflectionMethod->invokeArgs() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:1071
PHP  12. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->it_emits_events_for_all_streams() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:1071
PHP  13. spl_autoload_call() /Users/bas/standard-projections/tests/MessageNameStreamProjectionRunnerTest.php:39
PHP  14. Composer\Autoload\ClassLoader->loadClass() /Users/bas/standard-projections/tests/MessageNameStreamProjectionRunnerTest.php:39
PHP  15. Composer\Autoload\includeFile() /Users/bas/standard-projections/vendor/composer/ClassLoader.php:322
PHP  16. include() /Users/bas/standard-projections/vendor/composer/ClassLoader.php:444

Fatal error: Class 'ProophTest\EventStore\Mock\TestDomainEvent' not found in /Users/bas/standard-projections/tests/Mock/TestDomainEvent.php on line 15

Call Stack:
    0.0007     358960   1. {main}() /Users/bas/standard-projections/vendor/phpunit/phpunit/phpunit:0
    0.0068     848216   2. PHPUnit\TextUI\Command::main() /Users/bas/standard-projections/vendor/phpunit/phpunit/phpunit:53
    0.0068     848328   3. PHPUnit\TextUI\Command->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/Command.php:148
    0.0417    2561408   4. PHPUnit\TextUI\TestRunner->doRun() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/Command.php:195
    0.0491    2711448   5. PHPUnit\Framework\TestSuite->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:546
    0.0637    3540728   6. PHPUnit\Framework\TestSuite->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestSuite.php:755
    0.0669    3540920   7. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestSuite.php:755
    0.0669    3540920   8. PHPUnit\Framework\TestResult->run() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:894
    0.0669    3541296   9. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->runBare() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestResult.php:698
    0.0670    3557816  10. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->runTest() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:939
    0.0670    3558112  11. ReflectionMethod->invokeArgs() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:1071
    0.0670    3558120  12. ProophTest\StandardProjections\MessageNameStreamProjectionRunnerTest->it_emits_events_for_all_streams() /Users/bas/standard-projections/vendor/phpunit/phpunit/src/Framework/TestCase.php:1071
    0.0670    3558552  13. spl_autoload_call() /Users/bas/standard-projections/tests/MessageNameStreamProjectionRunnerTest.php:39
    0.0670    3558632  14. Composer\Autoload\ClassLoader->loadClass() /Users/bas/standard-projections/tests/MessageNameStreamProjectionRunnerTest.php:39
    0.0671    3558744  15. Composer\Autoload\includeFile() /Users/bas/standard-projections/vendor/composer/ClassLoader.php:322
    0.0675    3561264  16. include('/Users/bas/standard-projections/tests/Mock/TestDomainEvent.php') /Users/bas/standard-projections/vendor/composer/ClassLoader.php:444

resource friendly projections required

from the chat by @basz :
when I run several long runing php processes (projection) how much memory should I expect those to use? according to newrelic 11 processes consume ~500Mb. time three for dev, staging production that kind of adds up. I’m wondering how accurate that metric is… Also I thought php7 was memory friendly and several processes can ‘share’ memory… Just qurious here

Bradley Weston @bweston92 Mrz. 14 16:56
@basz PHP isn't very memory friendly it adds extra data around stuff (http://php.net/manual/en/internals2.variables.intro.php). Example a string isn't just a string. However most programs don't just decrease memory when things aren't used anymore you have to wait for garbage collection which has to be enabled with zend.enable_gc=1

Can we do something to improve the situation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.