Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Specify time limit operation on a mongodb cursor #227

Closed
wants to merge 5 commits into from
Closed

Specify time limit operation on a mongodb cursor #227

wants to merge 5 commits into from

Conversation

ne0h12
Copy link
Contributor

@ne0h12 ne0h12 commented Aug 19, 2015

Termination processing operation if the associated cursor exceeds its allotted time limit. It is beneficial when PHP driver goes on timeout (by default 30 seconds). As a results mongodb keep health on highload projects because of not performing not needed operations.

Thanks. Sorry for my english.

@jmikola jmikola added this to the 1.3.0 milestone Aug 20, 2015
* @param integer $ms
* @return self
*/
public function maxTimeMS($ms);
Copy link
Member

Choose a reason for hiding this comment

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

@alcaeus: We may have shot ourselves in the foot here, but AFAIK we cannot add a new method to the interface without bumping to a new major version. This has come up with the collection interfaces in Doctrine Common before.

/cc @Ocramius

Copy link
Member

Choose a reason for hiding this comment

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

Technically speaking, yes. This is a BC break and thus would force us to go 2.0. I'm kicking myself now for not catching all methods that were added in the 1.5 driver.

Copy link
Member

Choose a reason for hiding this comment

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

@ne0h12: Unfortunately, this needs to be removed. We cannot add new interface methods without bumping a major version.

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, I removed it

@ne0h12
Copy link
Contributor Author

ne0h12 commented Aug 21, 2015

@jmikola why Scrutinizer says that checks failed, but when I opening details, then I do not see the errors ? What am i doing wrong ? Thank.

@jmikola
Copy link
Member

jmikola commented Aug 25, 2015

@ne0h12: I'm not sure what happened with Scrutinizer, but I wouldn't worry too much about it.

$this->maxTimeMS = (integer)$ms;
$this->mongoCursor->maxTimeMS((integer)$ms);
}
return $this;
Copy link
Member

Choose a reason for hiding this comment

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

@ne0h12: The most compatible solution would be to call MongoCursor::addOption('$maxTimeMS', $ms) here, as it doesn't depend on the driver's method at all.

@jmikola
Copy link
Member

jmikola commented Aug 25, 2015

@alcaeus: Note, I believe this also needs to go into master (it was rightfully opened against it) since we're adding new methods.

@alcaeus
Copy link
Member

alcaeus commented Aug 25, 2015

@jmikola I agree.

@alcaeus
Copy link
Member

alcaeus commented Jan 6, 2016

Closed manually in 7b4d519. Thanks!

@alcaeus alcaeus closed this Jan 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants