ANALYSIS OF CONNECTION METHODS OF TELEGRAM ROBOTS WITH SERVER PART

Authors

  • Elena Aleksandrovna Kavats
  • Artem Aleksandrovich Kostenko

DOI:

https://doi.org/10.34185/1562-9945-3-122-2019-03

Keywords:

Telegram, Polling, Webhook, pyTelegramBotAPI, Python, Long Polling, API, testing, performance, SSL certificate

Abstract

The paper analyzes the methods of interaction of robotic applications with Telegram servers. A comparison was made between the standard polling method (Long Polling) and Webhook, both from the speed of application interaction with the end user and the complexity of the installation from the point of view of the developer. The interaction mechanism of telegrams-bot with Webhook-enabled telegram servers, which significantly improves the performance of the program as a whole, saving the user’s query execution time and increasing fault tolerance.
The purpose of the study is to compare the methods of interaction between the application-work Telegrams written in Python, as well as the implementation of these methods in practice, in order to identify the complexity of writing both solutions.
The Webhook method is a way to deliver real-time data to applications. Unlike traditional APIs, where you need to specify data more often to get information in real time, Webhook sends data immediately.
It is proposed to consider the two most common communication options work and the Telegram server. The most common option is to periodically poll the Telegram servers for new information. All this is done through Long Polling, that is, the use opens for a short time and all updates immediately arrive bot.
In the work, an alternative communication option was proposed for the application to work with Telegram servers using Webhook. During the work on changing the data exchange method from standard polling (Long Polling) to Webhook, its indisputable advantage in loaded applications, namely on the number of incoming requests over a thousand, was proved (Long Polling).

References

Downey, Allen B. (May 2012). Think Python: How to Think Like a Computer Scientist (Version 1.6.6 ed.). ISBN 978-0-521-72596-5.

"RFC6202 - Known Issues and Best Practices for the Use of Long Polling and Streaming in Bidirectional HTTP".

Server-Push Documents (HTML & XHTML: The Definitive Guide) Archived 2008-04-17 at the Wayback Machine. O'Reilly book explaining server-push.

"What is push notifications & How do push notifications work?". www.push-maze.com. Retrieved 2018-10-25.

M. Thomson, E. Damaggio and B. Raymor (October 22, 2016). "Generic Event Delivery Using HTTP Push". Internet Draft. Internet Engineering Task Force. Retrieved October 28,2016.

Lutz, Mark (2013). Learning Python (5thed.). O'Reilly Media. ISBN 978-0-596-15806-4.

Pilgrim, Mark (2009). Dive Into Python 3. Apress. ISBN 978-1-4302-2415-0. Archived from the original on 2011-10-17.

Downloads

Published

2019-10-10