pjfanning commented on code in PR #1819: URL: https://github.com/apache/pekko/pull/1819#discussion_r2052339930
########## stream/src/main/scala/org/apache/pekko/stream/stage/GraphStage.scala: ########## @@ -1668,6 +1672,25 @@ trait AsyncCallback[T] { * to the invoking logic see [[AsyncCallback#invoke]] */ def invokeWithFeedback(t: T): Future[Done] + + /** + * Java API + * + * Dispatch an asynchronous notification. This method is thread-safe and + * may be invoked from external execution contexts. + * + * The method returns directly and the returned future is then completed once the event + * has been handled by the operator, if the event triggers an exception from the handler the future + * is failed with that exception and finally if the operator was stopped before the event has been + * handled the future is failed with `StreamDetachedException`. + * + * The handling of the returned future incurs a slight overhead, so for cases where it does not matter + * to the invoking logic see [[AsyncCallback#invoke]] + */ + def invokeWithFeedbackCompletionStage(t: T): CompletionStage[Done] = { + import pekko.util.FutureConverters._ + invokeWithFeedback(t).asJava + } Review Comment: is it possible to add a basic unit test? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org For additional commands, e-mail: notifications-h...@pekko.apache.org