-
Enhancement
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
When working with DistributedExecutorService I can do the following
DistributedTask<Boolean> distributedTask = taskBuilder.build(); Future<Boolean> future = des.submit(distributedTask); Boolean r = future.get();
But DistributedExecutorService is deprecated and we should use ClusterExecutor
As a developer, I would like to execute a function in another node and get the result.
I am expecting something like:
CompletableFuture<Boolean> future = master.executor().singleNodeSubmission(address, task); Boolean r = future.get();
Today, I need the following code to achieve the same result
class MutableString { String value; } MutableString mString = new MutableString(); SerializableFunction<EmbeddedCacheManager, String> callable = (cm) -> { return "foo"; }; TriConsumer<Address, String, Throwable> triConsumer = (a, v, t) -> { mString.value = v; }; master.executor().singleNodeSubmission().filterTargets(a -> a.equals(address)).submitConsumer(callable, triConsumer).get();