Answer the question
In order to leave comments, you need to log in
How to call a function from another thread?
I have
2 modules in my application 1.
Telegram
Bot
2. Web sockets
Both
work through endless loops. , I need to send this case to the cart.
I decided to hang the cart bot in a separate thread, but here's the problem. the TelegramBot class has a sendMessage method. Which I need to access from the websocket handler. What can you think of?
There was an idea. create 2 cart bot classes. send from one message, process others. Is there another way?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question