dcapwell commented on code in PR #40:
URL: https://github.com/apache/cassandra-accord/pull/40#discussion_r1157812358
##########
accord-core/src/test/java/accord/burn/BurnTest.java:
##########
@@ -191,10 +198,32 @@ static void burn(RandomSource random, TopologyFactory
topologyFactory, List<Id>
{
List<Throwable> failures = Collections.synchronizedList(new
ArrayList<>());
PendingQueue queue = new PropagatingPendingQueue(failures, new
Factory(random).get());
+ SimulatedDelayedExecutorService globalExecutor = new
SimulatedDelayedExecutorService(queue, random.fork());
StrictSerializabilityVerifier strictSerializable = new
StrictSerializabilityVerifier(keyCount);
+ ListExecutor listExecutor = new ListExecutor()
+ {
+ @Override
+ public <T> AsyncChain<T> submit(Supplier<T> fn)
+ {
+ return globalExecutor.submit(fn::get);
+ }
+
+ @Override
+ public <T> AsyncChain<T> submit(Supplier<T> fn, long delay,
TimeUnit unit)
+ {
+ return globalExecutor.submit(fn::get, delay, unit);
+ }
+
+ @Override
+ public AsyncChain<Void> execute(Runnable fn)
+ {
+ return globalExecutor.submit(fn).map(ignore -> null);
+ }
+ };
+ Function<CommandStore, ListExecutor> executor = ignore -> listExecutor;
Review Comment:
I did this for backwards compatibility, wondering if I should simplify this
by just passing in a `SimulatedDelayedExecutorService` or create a new
`AsyncExecutor` interface?
--
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]