{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Client pool","type":"basic","slug":"telegramclientpool","excerpt":"com.github.badoualy.telegram.api.TelegramClientPool","body":"If for some reason you need to keep multiple clients opened, Kotlogram helps you with that.\nThe class `TelegramClientPool` is basically a `Map` in which you can put client, with a timeout value.\nOnce the client timeout, it'll be automatically closed, and you'll have a callback fired.\n\nFor convenience, two pools are available\n- `DefaultPool`: used for *normal* clients\n- `DownloadPool` to store client probably created by `getDownloaderClient` method. The clients you put in this pool will probably have a shorter timeout value.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"TelegramClientPool.DEFAULT_POOL;\\nTelegramClientPool.DOWNLOADER_POOL;\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57e38c7b4d659c0e0006e90d","project":"5703d527bb69fc1700553ce0","__v":0,"createdAt":"2016-09-22T07:47:07.593Z","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Api module","slug":"api-module","order":4,"from_sync":false,"reference":false,"_id":"57e0f14b8929550e00f1d9bc","createdAt":"2016-09-20T08:20:27.114Z","__v":0,"version":"5703d527bb69fc1700553ce3","project":"5703d527bb69fc1700553ce0"},"githubsync":"","version":{"version":"0.0.6","version_clean":"0.0.6","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["5703d527bb69fc1700553ce4","5703d8b7aceacc17003ef303","5703e60b6116142000db25f6","57e0db616a1c2e0e0081fe64","57e0f141ff540c22007b45fa","57e0f14b8929550e00f1d9bc"],"_id":"5703d527bb69fc1700553ce3","createdAt":"2016-04-05T15:09:27.620Z","hasDoc":true,"releaseDate":"2016-04-05T15:09:27.620Z","__v":6,"hasReference":true,"project":"5703d527bb69fc1700553ce0"},"parentDoc":null,"user":"5631f962c3b04b0d00ba9bf1"}

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. [block:code] { "codes": [ { "code": "TelegramClientPool.DEFAULT_POOL;\nTelegramClientPool.DOWNLOADER_POOL;", "language": "java" } ] } [/block]