New client factory method
This commit is contained in:
parent
df281862fe
commit
660a6b0a3b
@ -26,7 +26,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.tdlight</groupId>
|
<groupId>it.tdlight</groupId>
|
||||||
<artifactId>tdlight-java-bom</artifactId>
|
<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>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -16,7 +16,7 @@ public class AdvancedExample {
|
|||||||
Init.init();
|
Init.init();
|
||||||
|
|
||||||
// Create a client manager, it should be closed before shutdown
|
// 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
|
// Create a client, it should be closed before shutdown
|
||||||
TelegramClient client = clientManager.createClient();
|
TelegramClient client = clientManager.createClient();
|
||||||
|
@ -23,6 +23,13 @@ public interface ClientFactory extends AutoCloseable {
|
|||||||
return common;
|
return common;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new Client Factory
|
||||||
|
*/
|
||||||
|
static ClientFactory create() {
|
||||||
|
return new ClientFactoryImpl();
|
||||||
|
}
|
||||||
|
|
||||||
TelegramClient createClient();
|
TelegramClient createClient();
|
||||||
|
|
||||||
ReactiveTelegramClient createReactive();
|
ReactiveTelegramClient createReactive();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user