Похожие чаты

In rextester bot 2.x, I had big hashmap with state,

and I had bluebird promises representig message processing there, and if someone edited a message while it was still being processed, I cancelled the promise and started processing again.

In 3.x I decided to have as little state in memory as possible; I still need a way to cancel message processing.

My first thought was to store only the promises in memory, rest data in redis, and use pub-sub to broadcasr cancellation event to other instances (in case it would be running in a cluster).

But, I think I'll go for something more subtle -- each time a message is processed, set an uuid on the data. If it changes, message was edited, and job should cancel itself.

What do you think?

2 ответов

3 просмотра
Wojciech-Pawlik Автор вопроса

Long story short, is setting new uuid on update good way of notifying about update?

so in the first one you're storing whole promises, rest data and emitting cancelation events, and in the second one you store all the data and add uuid to all of it?

Похожие вопросы

Обсуждают сегодня

А еще в перле можно уже @arr1 + @arr2?
Sergei Zhmylove
48
I arrived here after a Chico Crypto show highlighted the project & the Team - the fact that the Team had a long history of successfully working with household names gave me e...
Banter is Bullish
1
Привет всем. появился вопрос. Разрабатываю сайт, в данный момент он запущен. Хостинг beget. Добавляю на сайт яндекс метрику с помощью полей client-settings (взято отсюда http...
Andrew
2
;.686 ;Система команд процессора 686 ;.MODEL FLAT,stdcall ;Модель памяти плоская, стандартный ;вызов процедуры ;option casemap:no...
Егор Анелькин
1
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Почему у макбука экран не сенсорный?
✨ Anatolii Cherednichenko
28
а как ловят такое ghci> res <- getPos2 urlt 0 (alist !! 0) 200 ghci> res SearchAtom (Search "www.google.com" "/search?q=" "Haskell") "haskell.org" (SearchTS [(2024-05-06 07:...
Fedor
14
Is it a good price to buy hex now on 0,0019?
Patrick
29
ну выйграл ты ее а дальше что?
central hardware
17
Ребята, а из API геокодеров (по адресам в РФ) что сейчас актуального и есть ли среди актуального бесплатное/с нормаотным лимитом запросов? ситуация простая - на сайте периоди...
Dreamer_0x01 VeseloV
8
Карта сайта