-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design the reactive event handler architecture #10
Comments
While I have to look through more of Teloxide, I do know of and have used serenity before. While using serenity, I do like how they they allow you to register an event handler in some parts, to allow you to listen to events from discord. While for other parts, such as here they let you register commands as functions, and group them together using macros, along with attaching permissions, though this may not require such grouping, or maybe so if your listening to chat events, I still do love the system that they use. As for other callbacks, one of my suggestions would be while, still allowing users to register callbacks to listen to socket events, another cool feature would be to have the client |
Now that the client is somewhat structured, we can start to think about how messages coming from Steam should propagate through the client, in a way the end-user can interact with them.
While searching for references, two libraries reactive libraries come to mind:
Teloxide and Serenity
Teloxide code is rather intricate, and I not sure I follow it completely.
Serenity is ok.
The event dispatcher:
The user could register "channels" that he is interested, such as SteamFriends(friends messages, friends persona status changes), or SteamUser(logOn, logOff).
This is what SteamKit2 does, and what message goes to which channel is kind arbitrary.
Then, the user can send outgoing messages, or answer to incoming ones based on his callbacks.
The basic flow would be the following, excluding the initial communication and heartbeat:
We are open to new ideas!
The text was updated successfully, but these errors were encountered: