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
Allow more configuration on data caching #1042
base: development
Are you sure you want to change the base?
Conversation
This might offer some new ways to handle update events and might also allow to enable a light mode
# Conflicts: # src/main/java/net/dv8tion/jda/internal/JDAImpl.java
I also want to add a flag to switch between either digest events or atomic events. That way we move more towards 1:1 mapping of the events rather than 1:N like we do currently. |
# Conflicts: # src/main/java/net/dv8tion/jda/internal/JDAImpl.java
This is probably not needed when we allow lazy loading and disabling guild subscriptions. |
@@ -85,13 +81,14 @@ public JDA getJDA() | |||
@Override | |||
public OffsetDateTime getTimeJoined() | |||
{ | |||
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(joinDate), OFFSET); | |||
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(data.getTimeBoosted()), OFFSET); |
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.
Should be replaced with data.getTimeJoined()
instead.
return this; | ||
} | ||
|
||
public MemberImpl setJoinDate(long joinDate) | ||
{ | ||
this.joinDate = joinDate; | ||
this.data.setTimeBoosted(joinDate); |
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.
Should be replaced with this.data.setTimeJoined(joinDate)
instead.
I want to revisit this for 4.3.0. I also want to make an easy switch to use the LIGHT mode on all entities by default like: |
# Conflicts: # src/main/java/net/dv8tion/jda/api/JDABuilder.java # src/main/java/net/dv8tion/jda/api/sharding/DefaultShardManager.java # src/main/java/net/dv8tion/jda/internal/JDAImpl.java # src/main/java/net/dv8tion/jda/internal/entities/GuildImpl.java # src/main/java/net/dv8tion/jda/internal/entities/MemberImpl.java
A lot of these configurations are unnecessary
Pull Request Etiquette
Changes
Closes Issue: NaN
Description
With these changes I introduce
XData
andMutableXData
interfaces which can be used to provideXUpdateDigestEvent
rather than atomic events for each changed property. These interfaces can be implemented by the library user and provided using a callback.We provide 2 implementations by default:
You could easily implement custom providers by extending the existing
LIGHT
configuration:Example using rich and having digest events enabled:
Output: