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

Some refactoring to simplify a few things #220

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Some refactoring to simplify a few things #220

merged 2 commits into from
Oct 12, 2023

Conversation

bmeike
Copy link
Contributor

@bmeike bmeike commented Oct 11, 2023

Rename the logger: it used to be in a package called "support", which, I think, was meant to hold a bunch of utility stuff. Logging was the only thing there, though, so I've moved it to a package called "logging" for clarity
Move the Listener interface: Similarly, the listener interface obviously belongs in the listener package. Put it there
Convert C4CollectionDocObserver and C4CollectionObserver to TaggedWeakPeerBinding: TaggedWeakPeerBinding is more explicit that peer binding and should be used wherever possible. Only Sockets still use the latter.

All tests pass on multiple devices

Move the Listener interface
Convert C4CollectionDocObserver and C4CollectionObserver to TaggedWeakPeerBinding
@bmeike bmeike requested a review from pasin October 11, 2023 21:40
* @param ign1 ref for the C4Document observer: ignored
* @param ign2 ref for the C4Collection: ignored
* @param ign3 the doc id: ignored
* @param context the token bound to the observer instance.
Copy link
Contributor

Choose a reason for hiding this comment

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

There are 5 params. docID is mixed up with ign3 in the comment above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


// Requiring implementer to specify the types of both T and the ChangeListener for T
// is pretty ugly and annoying. I could not figure out another way to do it, though...
public interface Listenable<T, L extends ChangeListener<T>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I might have missed. I don't see it is implemented anywhere in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow.... good catch!!

I have no idea what happened there....

@bmeike bmeike merged commit 2d53184 into master Oct 12, 2023
@bmeike bmeike deleted the pr/refactor branch October 12, 2023 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants