mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 12:30:39 +00:00
Modified the Manager class to provide an ExecuterService for the SignalServiceMessageSender.
This commit is contained in:
parent
c276055302
commit
b48410a5dc
1 changed files with 7 additions and 1 deletions
|
@ -167,6 +167,8 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -189,6 +191,9 @@ public class Manager implements Closeable {
|
|||
private final SignalServiceMessageReceiver messageReceiver;
|
||||
private final ClientZkProfileOperations clientZkProfileOperations;
|
||||
|
||||
private final ExecutorService executor = new ThreadPoolExecutor(0, 10, 10, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); //Todo added by me
|
||||
|
||||
|
||||
private SignalServiceMessagePipe messagePipe = null;
|
||||
private SignalServiceMessagePipe unidentifiedMessagePipe = null;
|
||||
|
||||
|
@ -526,7 +531,6 @@ public class Manager implements Closeable {
|
|||
}
|
||||
|
||||
private SignalServiceMessageSender createMessageSender() {
|
||||
final ExecutorService executor = null;
|
||||
return new SignalServiceMessageSender(serviceEnvironmentConfig.getSignalServiceConfiguration(),
|
||||
account.getUuid(),
|
||||
account.getUsername(),
|
||||
|
@ -2533,6 +2537,8 @@ public class Manager implements Closeable {
|
|||
}
|
||||
|
||||
void close(boolean closeAccount) throws IOException {
|
||||
executor.shutdown();
|
||||
|
||||
if (messagePipe != null) {
|
||||
messagePipe.shutdown();
|
||||
messagePipe = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue