Skip to content
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

channels: turn MessageStore into trait #386

Closed
jondot opened this issue Jan 23, 2024 · 1 comment
Closed

channels: turn MessageStore into trait #386

jondot opened this issue Jan 23, 2024 · 1 comment

Comments

@jondot
Copy link
Contributor

jondot commented Jan 23, 2024

Then supply:

  • InMemoryMessageStore: inprocess/current process persistence of messages
  • DBMessageStore: hooks into our DB implementation, also provides table migrations, through a generator

Notes:

  • In both cases we should strive for most of the logic to turn into a generic logic that appears in the framework, and then some "glue" that appears in code that is generated.
  • Once we use a MessageStore trait, we can now provide event handlers as well, by chat models. Because we set up the trait in app.rs this can seamlessly persist data to DB, and the user configures almost nothing to get a fully functioning chat.
    • SingleRoomChatModel - join leaves all channels, then joins a selected room, message appends a message
    • MultiRoomChatModel - join joins a new room, message selects which room to append to, leave leaves a room
@kaplanelad
Copy link
Contributor

see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants