New client factory method
This commit is contained in:
parent
df281862fe
commit
660a6b0a3b
@ -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>
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user