New client factory method

This commit is contained in:
Andrea Cavalli 2023-05-19 01:28:07 +02:00
parent df281862fe
commit 660a6b0a3b
3 changed files with 9 additions and 2 deletions

View File

@ -26,7 +26,7 @@
<dependency>
<groupId>it.tdlight</groupId>
<artifactId>tdlight-java-bom</artifactId>
<version>3.0.5+td.1.18.4</version>
<version>3.0.6+td.1.8.14</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -16,7 +16,7 @@ public class AdvancedExample {
Init.init();
// Create a client manager, it should be closed before shutdown
ClientFactory clientManager = new ClientFactory();
ClientFactory clientManager = ClientFactory.create();
// Create a client, it should be closed before shutdown
TelegramClient client = clientManager.createClient();

View File

@ -23,6 +23,13 @@ public interface ClientFactory extends AutoCloseable {
return common;
}
/**
* Create a new Client Factory
*/
static ClientFactory create() {
return new ClientFactoryImpl();
}
TelegramClient createClient();
ReactiveTelegramClient createReactive();