Telegram.Bot.Framework icon indicating copy to clipboard operation
Telegram.Bot.Framework copied to clipboard

Redesign IUpdateManager interface and implementation

Open tuscen opened this issue 8 years ago • 0 comments

Scoped lifetime of IUpdateManager<TBot> and polling functionality built in it don't play well together. An entity that performs polling should be a singleton.

IUpdateManager<TBot> functionality should be split to two interfaces:

  • IUpdateDispatcher<TBot> that performs dispatching and could has either scoped or transient lifetime
  • An entity that performs actual polling and has dependency on a factory that creates IUpdateDisptacher<TBot> instance and has singleton lifetime so it correctly incapsulates update offset

tuscen avatar Mar 02 '18 18:03 tuscen