How to make it so that tdlib operates like a daemon? #140
-
Is there any sample in C# such that Somehow this example from tdlib can do void loop() {
while (true) {
if (need_restart_) {
restart();
} else if (!are_authorized_) {
process_response(client_manager_->receive(10));
} else { Is there a way to mirror this Using strongly typed APIs? Or do I have to use the untyped version to be able to make some sort of daemon approach? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I don't think we support the |
Beta Was this translation helpful? Give feedback.
-
But I can't see how it relates to your daemon question. What do you mean by that? AFAIK, tdlib just normally updates its database during execution; there's no special "daemon approach" or something like that. |
Beta Was this translation helpful? Give feedback.
-
Hi @ForNeVeR ,
I have created a simple application in CLI however I have been left in a request and response model. I would like to know if it's possible to have a concurrent approach to request & response wherein the CLI will not shutdown but always receive updates. Can you recommend a simple pattern for this? For now when my cli app for example lists chats and messages in chats, the application stops after completion. What I'm looking for is to keep tdlib awake and keep on receiving updates and my cli app can then just listen to the updates indefinitely. I may be missing something fundamental here though. I will look in to |
Beta Was this translation helpful? Give feedback.
-
The usual pattern for daemon-like code in C# is to use a Generic Host, that has no relation to tdlib's |
Beta Was this translation helpful? Give feedback.
The usual pattern for daemon-like code in C# is to use a Generic Host, that has no relation to tdlib's
ClientManager
whatsoever.