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

Observe once #58

Merged
merged 3 commits into from
Feb 18, 2015
Merged

Observe once #58

merged 3 commits into from
Feb 18, 2015

Conversation

brummett
Copy link
Contributor

This adds a 'once' attribute to Observers. Their callbacks will only run once, then the observer will be deleted. It's deleted before the callback runs, so we won't have to worry about recursive calls, such as when calling commit() in a commit observer.

The observer will get removed after the callback runs
This prevents the callback from recursively calling itself.  Genome had a
'commit' observer that was, itself, committing.  It needed to jump through
hoops to prevent the callback from getting recursively called inside the
inner commit().
@ebelter
Copy link
Member

ebelter commented Feb 13, 2015

+1 pending tests. Looks useful!

@nnutter
Copy link
Contributor

nnutter commented Feb 13, 2015

I had setup apipe-ci/genome-integration to use the test DB but the current DB snapshot produces these failures. I've disabled the usage of the test DB and rebuilt. The continuous-integration/travis-ci is something I noticed was failing the other day but hoped it was some transient issue with Travis CI but it looks like we'll have to look into it.

@brummett
Copy link
Contributor Author

The travis-ci failure seems to be a real problem just for this branch. The same test failed twice in the same way, though only on Perl 5.8. I'm looking into it.

@nnutter
Copy link
Contributor

nnutter commented Feb 13, 2015

The travis-ci failure seems to be a real problem just for this branch. The same test failed twice in the same way, though only on Perl 5.8. I'm looking into it.

To be absolutely clear, this failure is not due to the changes in this PR. At some point origin/master worked on Travis CI (unless someone bypassed PR testing) and now it is not. So it seems most likely to be due to a change in a dependency.

@nnutter
Copy link
Contributor

nnutter commented Feb 18, 2015

Travis CI appears to have changed the name of the "context" they use so the failure status for continuous-integration/travis-ci can be ignored.

@nnutter
Copy link
Contributor

nnutter commented Feb 18, 2015

👍 Ready for merge.

brummett added a commit that referenced this pull request Feb 18, 2015
@brummett brummett merged commit 7f8f8d4 into genome:master Feb 18, 2015
@brummett brummett deleted the observe-once branch February 18, 2015 15:37
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