Skip to content

Instantly share code, notes, and snippets.

@push-gists
Last active August 2, 2016 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save push-gists/a36ac6517c656635c789fde123a2ba3d to your computer and use it in GitHub Desktop.
Save push-gists/a36ac6517c656635c789fde123a2ba3d to your computer and use it in GitHub Desktop.
Add a transformed stream
session
.feature(Topics.class)
.addStream(
"binary/data",
Binary.class,
new StreamAdapter<>(
value -> new String(value.toByteArray()),
new TransformedStream.Default<Binary, String>() {
@Override
public void onValue(
String topicPath,
TopicSpecification specification,
String oldValue,
String newValue) {
// Do something awesome
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment