Last active
August 2, 2016 21:45
-
-
Save push-gists/d054ec077c1a9e71acb4378e0b22db04 to your computer and use it in GitHub Desktop.
Add a generic transformed stream by using a StreamBuilder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamBuilders.newBinaryStreamBuilder() | |
.transform(Bytes::toByteArray) | |
.transform(String::new) | |
.create( | |
session.feature(Topics.class), | |
"binary/data", | |
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