/** * Produces a flow of ByteString with a prepended block and a script wrapper. * * @param callbackName the javascript callback method. * @return a flow of ByteString elements. */ public static Flow<ByteString, ByteString, NotUsed> flow(String callbackName) { ByteString cb = ByteString.fromString(callbackName); return Flow.of(ByteString.class).map((msg) -> { return formatted(cb, msg); }).prepend(Source.single(initialChunk)); }
/** * Produces a flow of ByteString with a prepended block and a script wrapper. * * @param callbackName the javascript callback method. * @return a flow of ByteString elements. */ public static Flow<ByteString, ByteString, NotUsed> flow(String callbackName) { ByteString cb = ByteString.fromString(callbackName); return Flow.of(ByteString.class).map((msg) -> { return formatted(cb, msg); }).prepend(Source.single(initialChunk)); }
/** * Produces a flow of ByteString with a prepended block and a script wrapper. * * @param callbackName the javascript callback method. * @return a flow of ByteString elements. */ public static Flow<ByteString, ByteString, NotUsed> flow(String callbackName) { ByteString cb = ByteString.fromString(callbackName); return Flow.of(ByteString.class).map((msg) -> { return formatted(cb, msg); }).prepend(Source.single(initialChunk)); }