Skip to content

Instantly share code, notes, and snippets.

@efenderbosch
Created March 14, 2018 18:12
Show Gist options
  • Save efenderbosch/93abe885afa0e7fdbd486a87b8cc4263 to your computer and use it in GitHub Desktop.
Save efenderbosch/93abe885afa0e7fdbd486a87b8cc4263 to your computer and use it in GitHub Desktop.
public class PublishingInMemoryFeatureStore extends InMemoryFeatureStore {
@Override
public <T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item) {
String key = item.getKey();
T current = get(kind, key);
super.upsert(kind, item);
T updated = get(kind, key);
if (!Objects.equals(current, updated)) {
// do publish
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment