NicoNex / echotron

An elegant and concurrent library for the Telegram bot API in Go.
https://t.me/s/echotronnews
GNU Lesser General Public License v3.0
363 stars 26 forks source link

Update dispatcher.go Added Stop() #49

Closed Caycedo closed 1 month ago

Caycedo commented 1 month ago

The use of sync.Map for sessionMap improves thread safety. sync.Map eliminates the need for manual locking in most places. The PollOptions function now uses a context with timeout, which helps manage long-polling operations more effectively. The getUpdatesWithTimeout function provides a good mechanism to handle timeouts and other errors from the Telegram API. The Stop method has a timeout mechanism to prevent indefinite hanging.