Skip to content

Why should Core#runCallbacks be run this often? #77

Answered by JnCrMx
Desoroxxx asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Desoroxxx
Comment options

Answer selected by Desoroxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants