Skip to content

Conversation

alanpoon
Copy link
Contributor

This makes accessing Matrix Client in background thread and callback in UI thread easier.

This follows the design of cx.http_request.

@alanpoon alanpoon self-assigned this Aug 21, 2025
@alanpoon alanpoon added the waiting-on-review This issue is waiting to be reviewed label Aug 21, 2025
Copy link
Member

@kevinaboos kevinaboos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Alan, I like the general idea of abstracting generic functions to perform arbitrary backend functions in background tasks.

I do have a few questions:

  1. My main concern with this design pattern is that it seems to encourage usage of the Client object. In most cases, accessing a piece of data through the Client is the least efficient way to do so, so I'd like to hear about more use cases that motivate this.
  2. why does the request_id need to be a LiveId? Live IDs are typically related to a UI element or widget or something?
    • Seems like it could be any generic type that implements PartialEq.
  3. the func closure returns a Boxed Any. Is that necessary? Any has quite a few limitations; I'm wondering if we can also use generics here, but we don't necessarily have to do that at first.
    • In fact, you already use a generic type T within the MatrixClientAction enum...

@kevinaboos kevinaboos added waiting-on-author This issue is waiting on the original author for a response and removed waiting-on-review This issue is waiting to be reviewed labels Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author This issue is waiting on the original author for a response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants