From 7ea5e9ac73199f264961e5d9845f302b41108e13 Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Mon, 30 Dec 2019 07:01:56 +0200 Subject: Asynchronous message processing with guaranteed sequential per-chat delivery --- telegram/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'telegram/client.go') diff --git a/telegram/client.go b/telegram/client.go index dde15f2..7e7cdc8 100644 --- a/telegram/client.go +++ b/telegram/client.go @@ -55,6 +55,7 @@ type Client struct { type clientLocks struct { authorizationReady sync.WaitGroup + chatMessageLocks map[int64]*sync.Mutex } // NewClient instantiates a Telegram App @@ -107,6 +108,8 @@ func NewClient(conf config.TelegramConfig, jid string, component *xmpp.Component content: &conf.Content, cache: cache.NewCache(), options: options, - locks: clientLocks{}, + locks: clientLocks{ + chatMessageLocks: make(map[int64]*sync.Mutex), + }, }, nil } -- cgit v1.2.3