set threadcount in start

This commit is contained in:
MrBesen 2020-12-30 09:41:12 +01:00
parent 39d99685d1
commit e2eb71a1a6
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 7 additions and 1 deletions

View File

@ -72,7 +72,7 @@ public class TelegramAPI implements Runnable {
private FeedbackCommand feedbackCmd;
//async
private AsyncHandler async = new AsyncHandler(this);
private AsyncHandler async = null;
public static Callback<Throwable, Void> IOE400supressor = new Callback<Throwable, Void>() {
@Override
public Void call(Throwable t) throws Throwable {
@ -108,7 +108,13 @@ public class TelegramAPI implements Runnable {
}
public void start() {
start(1);
}
//start with a specified threadcount for async operations
public void start(int threadCount) {
if(thread == null) {
async = new AsyncHandler(this, threadCount);
if(!disableFeedback) {
//init Feedback
feedbackCmd = new FeedbackCommand(this, admins);