Support callback for Matrix Client request#573
Open
alanpoon wants to merge 1 commit intoproject-robius:mainfrom
Open
Support callback for Matrix Client request#573alanpoon wants to merge 1 commit intoproject-robius:mainfrom
alanpoon wants to merge 1 commit intoproject-robius:mainfrom
Conversation
kevinaboos
reviewed
Aug 21, 2025
Member
kevinaboos
left a comment
There was a problem hiding this comment.
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:
- My main concern with this design pattern is that it seems to encourage usage of the
Clientobject. In most cases, accessing a piece of data through theClientis the least efficient way to do so, so I'd like to hear about more use cases that motivate this. - why does the
request_idneed to be aLiveId? Live IDs are typically related to a UI element or widget or something?- Seems like it could be any generic type that implements
PartialEq.
- Seems like it could be any generic type that implements
- the
funcclosure returns a BoxedAny. Is that necessary?Anyhas 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
Twithin the MatrixClientAction enum...
- In fact, you already use a generic type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes accessing Matrix Client in background thread and callback in UI thread easier.
This follows the design of cx.http_request.