Feature - RExecutorService.deregisterWorkers() method added. #6448

pull/6449/head
mrniko 7 days ago
parent ac2f9be1b5
commit a7a3fa5a7f

@ -471,12 +471,17 @@ public class RedissonExecutorService implements RScheduledExecutorService {
} }
@Override @Override
public void shutdown() { public void deregisterWorkers() {
queueTransferService.remove(getName()); queueTransferService.remove(getName());
remoteService.deregister(RemoteExecutorService.class); remoteService.deregister(RemoteExecutorService.class);
if (workersGroupListenerId != 0) { if (workersGroupListenerId != 0) {
workersTopic.removeListener(workersGroupListenerId); workersTopic.removeListener(workersGroupListenerId);
} }
}
@Override
public void shutdown() {
deregisterWorkers();
commandExecutor.get(commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_VOID, commandExecutor.get(commandExecutor.evalWriteAsync(getName(), LongCodec.INSTANCE, RedisCommands.EVAL_VOID,
"if redis.call('exists', KEYS[2]) == 0 then " "if redis.call('exists', KEYS[2]) == 0 then "

@ -202,6 +202,12 @@ public interface RExecutorService extends ExecutorService, RExecutorServiceAsync
*/ */
void registerWorkers(WorkerOptions options); void registerWorkers(WorkerOptions options);
/**
* Deregister all workers
*
*/
void deregisterWorkers();
/** /**
* Returns amount of tasks awaiting execution or currently in execution. * Returns amount of tasks awaiting execution or currently in execution.
* *

Loading…
Cancel
Save