-
Notifications
You must be signed in to change notification settings - Fork 23
chore: Mode resolution and switching for FDv2 #326
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
base: main
Are you sure you want to change the base?
Changes from all commits
d92af88
8b8bd7e
8b1af40
2d1b776
05f9536
c67b550
8976bfb
b160c58
fbcf5f6
4def25e
e623fd6
422bea2
5473232
5c6ac49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.launchdarkly.sdk.android; | ||
|
|
||
| /** | ||
| * Enumerates the built-in FDv2 connection modes. Each mode maps to a | ||
| * {@link ModeDefinition} that specifies which initializers and synchronizers | ||
| * are active when the SDK is operating in that mode. | ||
| * <p> | ||
| * Not to be confused with {@link ConnectionInformation.ConnectionMode}, which | ||
| * is the public FDv1 enum representing the SDK's current connection state | ||
| * (e.g. POLLING, STREAMING, SET_OFFLINE). This class is an internal FDv2 | ||
| * concept describing the <em>desired</em> data-acquisition pipeline. | ||
| * <p> | ||
| * This is a closed enum — custom connection modes (spec 5.3.5 TBD) are not | ||
| * supported in this release. | ||
| * <p> | ||
| * Package-private — not part of the public SDK API. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be worth adding a comment to help distinguish this type from the ConnectionInformation.ConnectionMode. I think we also have to develop a strategy for deprecating / updating the existing ConnectionMode status APIs. We don't have to solve that completely before this merges, but we need to make sure it isn't going to be painful.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've addressed this in my latest push 👍 |
||
| * | ||
| * @see ModeDefinition | ||
| * @see ModeResolutionTable | ||
| */ | ||
| final class ConnectionMode { | ||
|
|
||
| static final ConnectionMode STREAMING = new ConnectionMode("streaming"); | ||
| static final ConnectionMode POLLING = new ConnectionMode("polling"); | ||
| static final ConnectionMode OFFLINE = new ConnectionMode("offline"); | ||
| static final ConnectionMode ONE_SHOT = new ConnectionMode("one-shot"); | ||
| static final ConnectionMode BACKGROUND = new ConnectionMode("background"); | ||
|
|
||
| private final String name; | ||
|
|
||
| private ConnectionMode(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return name; | ||
| } | ||
| } | ||
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.
The overloads of forDataSource need comments or perhaps a different name for the latter version to help someone understand the implication of each.
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've addressed this in my last push. Is it a problem if the comments directly reference FDv1 and FDv2?