-
Currently I run Am I missing something? Just to be clear I am not really concern about performance it most certainly doesn't matter, I am just weirded out by how often this would run for what it does |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, the library roughly follows the architecture of Discord's official library, which is designed as a callback based async library with some sort of event loop. The So for example, if you set a user activity (through the In the Java implementation, each of the
Therefore, it is required to regularly execute this method, so you won't miss any responses or events. For other applications, this architecture might end up being a little cumbersome, especially if there is no existing event loop. The easiest way to deal with that, is just to spin up a new thread and simulate an event loop that way. |
Beta Was this translation helpful? Give feedback.
Hi,
the library roughly follows the architecture of Discord's official library, which is designed as a callback based async library with some sort of event loop.
The
RunCallbacks
function is at the core of this architecture and basically receives new data from Discord and executes registered callbacks accordingly.Discord has most likely chosen this architecture, because it works well with games. There are no blocking calls, and
runCallbacks
can simply be executed in the game's main loop and also does not block (as long as none of the registered callbacks block).So for example, if you set a user activity (through the
ActivityManager
) the request gets sent to Discord over IPC. Discord the…