mapUsingService
transform that allows you to declare your code as "non-cooperative". Hazelcast will adapt to this by running the code in a dedicated thread."--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/d430ee55-c932-40ce-b32c-5f30f51161adn%40googlegroups.com.
Hi Joan,
submitToKeyOwner
is async variant of executeOnKeyOwner
. It may work for your use case.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0bb2d1b5-74e7-432b-a961-6ecc1e60e73fn%40googlegroups.com.
private static final ExecutorService blockingCallsPool = Executors.newFixedThreadPool(THREAD_COUNT);
private static void shutdownBlockingCallsPool() {
try{
blockingCallsPoool.shutdown();while(!blockingCallsPool.isTerminated()) {
//wait until all tasks are completed…,or use awaitTermination() & a timeout value
}}catch(Throwable t){t.printStackTrace();Thread.currentThread.interrupt();}}
private void attachShutDownHook(){
Runtime.getRuntime().addShutdownHook(new Thread(){
@Override
public void run() {
if(blockingCallsPool != null){
shutdownBlockingCallsPool();
}
}
});
}
public void submitWorkToHzDistributedExecutorService(Runable task, Object key){
blockingCalls.submit(new Thread(){
@Override
public void run() {
if(key != null){
hzIExecutorHandle.executeOnKeyOwner(task, key)
}
}
});
}
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/0bb2d1b5-74e7-432b-a961-6ecc1e60e73fn%40googlegroups.com.