[infinispan-issues] [JBoss JIRA] (ISPN-9686) Simplified clustered executor single node submission
William Burns (Jira)
issues at jboss.org
Tue Nov 6 13:02:00 EST 2018
[ https://issues.jboss.org/browse/ISPN-9686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13657423#comment-13657423 ]
William Burns edited comment on ISPN-9686 at 11/6/18 1:01 PM:
--------------------------------------------------------------
More than likely it would look something similar to:
{code}
master.executor().singleNodeSubmission().filterTarget(address).submitFunction(cm -> "foo").get();
{code}
was (Author: william.burns):
More than likely it would look something similar to:
{code}
master.executor().singleNodeSubmission().filterTargets(a -> a.equals(address)).submitFunction(cm -> "foo").get();
{code}
> Simplified clustered executor single node submission
> ----------------------------------------------------
>
> Key: ISPN-9686
> URL: https://issues.jboss.org/browse/ISPN-9686
> Project: Infinispan
> Issue Type: Enhancement
> Reporter: Diego Lovison
> Priority: Major
>
> When working with *DistributedExecutorService* I can do the following
> {code:java}
> DistributedTask<Boolean> distributedTask = taskBuilder.build();
> Future<Boolean> future = des.submit(distributedTask);
> Boolean r = future.get();
> {code}
> 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:
> {code:java}
> CompletableFuture<Boolean> future = master.executor().singleNodeSubmission(address, task);
> Boolean r = future.get();
> {code}
> Today, I need the following code to achieve the same result
> {code:java}
> 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();
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
More information about the infinispan-issues
mailing list