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

setPriority() for Request #438

Open
BenjyTec opened this issue Mar 4, 2022 · 1 comment
Open

setPriority() for Request #438

BenjyTec opened this issue Mar 4, 2022 · 1 comment
Milestone

Comments

@BenjyTec
Copy link

BenjyTec commented Mar 4, 2022

After reading the documentation and looking into the Request.java file, it seems like there is currently no option to easily set the Priority for a Request, neither via Setter or Constructor.
Is there any particular reason for this?
I already found posts on Stackoverflow on how to get the desired functionality, but as basic as this is, I'm still curious to find out why the 'obvious' way hasn't been implemented, as I guess there is a good reason for it.

Thanks for any clarification.

@jpd236
Copy link
Collaborator

jpd236 commented Mar 4, 2022

It's a fair enough point, given that there are other setters for mutable properties. But the semantics could be a bit strange to introduce now, in that you could end up in a world where you call setPriority, but it does nothing because the Request subclass being used has its own implementation of getPriority which behaves differently. We could fix this in the built-in requests like ImageRequest, but there's always a chance of other Request classes existing outside the library that should be fixed as well.

It's also likely we'd break compilation for many libraries which provide custom setPriority methods that would now be overriding the base method, without specifying @Override.

So I'm overall open to this... but given these risks, and that you can fairly easily subclass Request, and almost certainly will/should be doing so anyway to implement your own requests, I don't think it's much of a priority.

@jpd236 jpd236 added this to the 2.0.0 milestone Mar 4, 2022
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