lukecwik commented on a change in pull request #15807:
URL: https://github.com/apache/beam/pull/15807#discussion_r738922064
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/BeamFnDataClient.java
##########
@@ -34,28 +33,36 @@
*/
public interface BeamFnDataClient {
/**
- * Registers the following inbound receiver for the provided instruction id
and target.
+ * Registers the following inbound receiver for the provided instruction id.
*
* <p>The provided coder is used to decode inbound elements. The decoded
elements are passed to
* the provided receiver. Any failure during decoding or processing of the
element will complete
* the returned future exceptionally. On successful termination of the
stream, the returned future
* is completed successfully.
*
* <p>The receiver is not required to be thread safe.
+ *
+ * <p>Receivers for successfully processed bundles must be unregistered. See
{@link
+ * #unregisterReceiver} for details.
Review comment:
I wanted to make the caller of register responsible for the clean-up on
success, putting it in another object seemed to hide how the code worked.
On a minor note there was a minor reduction in how much state we needed to
mutate and additional objects we needed to create and track related to having
some kind of "unregister" handle.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]