dcapwell commented on code in PR #17:
URL: https://github.com/apache/cassandra-accord/pull/17#discussion_r1053836352


##########
accord-core/src/main/java/accord/utils/async/AsyncResult.java:
##########
@@ -0,0 +1,96 @@
+package accord.utils.async;
+
+import java.util.concurrent.Executor;
+import java.util.function.BiConsumer;
+
+/**
+ * Handle for async computations that supports multiple listeners and 
registering
+ * listeners after the computation has started
+ */
+public interface AsyncResult<V>

Review Comment:
   Benedict and I spoke in slack, and the summary is:
   
   1) to simplify the usage, make `AsyncResult` implement `AsyncChain`, this 
has 2 benefits: no more `toChain`, and `AsyncChains.forChain` can avoid the 
copy of the result and just return the original result (avoiding 2 extra CAS; 
this case exists in C*)
   2) AsyncChains.Head does not block multiple calls to `begin` which can allow 
multiple execution in Cassandra that were not possible before; we should block 
this.  This is localized to Head as `chain.map(...).beginAsResult()` would fail 
if begin was called multiple times



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to