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

MongoDB storage driver #133

Merged
merged 5 commits into from
Dec 23, 2014
Merged

MongoDB storage driver #133

merged 5 commits into from
Dec 23, 2014

Conversation

jmikola
Copy link
Contributor

@jmikola jmikola commented Dec 7, 2014

This supersedes #94 (cc: @iampersistent).

Richard Shank and others added 2 commits December 6, 2014 20:58
This includes all commits from #94.
This commit builds upon @iampersistent's work in #94.

The driver is now constructed with MongoCollection objects, which removes the previous MongoDB::selectCollection() logic. Additionally, the message sentAt field is now a BSON date and queue name was added to acknowledgeMessage()'s remove() criteria to be consistent with the SQL driver.
before_script:
- sh -c "if [ \"$TRAVIS_PHP_VERSION\" != \"hhvm\" ]; then pyrus install pecl/redis && pyrus build pecl/redis; fi"
- sh -c "if [ \"$TRAVIS_PHP_VERSION\" != \"hhvm\" ]; then echo \"extension=redis.so\" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ \"$TRAVIS_PHP_VERSION\" == \"hhvm\" ]; then composer require --dev mongofill/mongofill=dev-master --no-update; fi"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the Travis CI logs (see here), this is not taking effect on HHVM. Any ideas?

Copy link

Choose a reason for hiding this comment

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

this is because your command is invalid: https://travis-ci.org/bernardphp/bernard/jobs/43233639#L37

It should be =, not ==

Copy link

Choose a reason for hiding this comment

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

btw, I suggest running it as ``sh -e -c`, so that failures in this command make the build fail (or remove the sh wrapper entirely as pasting the command itself in the sh build script generated by Travis will work too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing out the operator error. As for the -e, mongofill is an optional dependency (like the redis extension), so I'm going to leave that as is. @henrikbjorn should probably consider changing all of them, though.

@jmikola
Copy link
Contributor Author

jmikola commented Dec 8, 2014

@henrikbjorn: It looks like some of the HHVM test failures are due to test cases taking longer than the allotted time (PHPUnit is defaulting them to one second due to strict mode). Perhaps some of these should be annotated differently, as discussed in this Stack Overflow answer?

@henrikbjorn
Copy link
Contributor

Annotate away :) but it seems like the increase is time is recent, maybe because of a new hhvm version.

{
$this->messages->remove(array(
'_id' => new MongoId((string) $receipt),
'queue' => (string) $queueName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really need the queue if you have the id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but it's basically a free check since the _id index will be used anyway. Since we do take both arguments, I think it's best to actually use them. This avoids the odd case where a user acknowledges a message but gets the queue name wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Check

@jmikola
Copy link
Contributor Author

jmikola commented Dec 21, 2014

@henrikbjorn: Travis is passing now. I think this is good to merge.

henrikbjorn added a commit that referenced this pull request Dec 23, 2014
@henrikbjorn henrikbjorn merged commit 7a183cd into bernardphp:master Dec 23, 2014
@henrikbjorn
Copy link
Contributor

Thanks :)

@jmikola jmikola deleted the mongodb branch December 30, 2014 15:40
@sagikazarmark
Copy link
Contributor

This is awesome.

@henrikbjorn
Copy link
Contributor

Ill try and get time for a new release soon, there are some changes and unfortunately there will be some more.

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.

4 participants