-
Notifications
You must be signed in to change notification settings - Fork 615
Encapsulate scheduling in an inner class #111
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
Conversation
/test smoke-tests-release |
} else { | ||
persistence = MemoryPersistence.createEagerGcMemoryPersistence(); | ||
} | ||
|
||
persistence.start(); | ||
localStore = new LocalStore(persistence, user); | ||
if (gc != null) { | ||
lruScheduler = gc.new Scheduler(asyncQueue, localStore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really strange to me. Can this be new gc.Scheduler()
? I am not sure if that would work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't, but I wrapped it in a static method so I guess it's a little less weird?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er, not static. Because it's not a static class. But a helper method.
@@ -99,6 +107,43 @@ public int getDocumentsRemoved() { | |||
} | |||
} | |||
|
|||
public class Scheduler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this PR! While there is some special-casing in FirestoreClient with this PR, I don't think it's necessarily more than before, and some of it might even go away if we always run LRU (for Memory persistence for example). The encapsulation in Scheduler
is really nice and hides all implementation details. Thanks.
Experimental. Try encapsulating lru scheduling in its own class.