Client pool

com.github.badoualy.telegram.api.TelegramClientPool

If for some reason you need to keep multiple clients opened, Kotlogram helps you with that.
The class TelegramClientPool is basically a Map in which you can put client, with a timeout value.
Once the client timeout, it'll be automatically closed, and you'll have a callback fired.

For convenience, two pools are available

  • DefaultPool: used for normal clients
  • DownloadPool to store client probably created by getDownloaderClient method. The clients you put in this pool will probably have a shorter timeout value.
TelegramClientPool.DEFAULT_POOL;
TelegramClientPool.DOWNLOADER_POOL;

Did this page help you?