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

Create terminal find widget lazily, add LazyValue helper #161526

Closed
wants to merge 1 commit into from

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Sep 22, 2022

@jrieken a review here would be appreciated as you wrote IdleValue. The idea here is similar to IdleValue but it won't initialize the value at all until requested. For this specific use case, I don't want to create find widgets for every terminal as it will often be a waste of cpu/battery/memory. I wouldn't be surprised if something like this already existed, but I couldn't find it if so.

@Tyriar Tyriar added this to the September 2022 milestone Sep 22, 2022
@Tyriar Tyriar requested a review from jrieken September 22, 2022 19:59
@Tyriar Tyriar self-assigned this Sep 22, 2022
@Tyriar
Copy link
Member Author

Tyriar commented Sep 22, 2022

fyi @meganrogge

Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Yeah, this already exists as Lazy and we shouldn't duplicate that.

However, I would always use the IdleValue because Lazy is a guarantee for "value is delayed when needed". The point of idle time is to use small remaining time chunks and be ready without blocking

@Tyriar
Copy link
Member Author

Tyriar commented Sep 23, 2022

@jrieken thanks for the pointer, do you think it's a good idea to derive IdleValue from Lazy like in the PR or keep them separate?

@jrieken
Copy link
Member

jrieken commented Sep 23, 2022

I'd keep them separate

@Tyriar
Copy link
Member Author

Tyriar commented Sep 23, 2022

Sounds good, will create a new PR for @meganrogge to review with just the terminal changes

@Tyriar Tyriar closed this Sep 23, 2022
@Tyriar Tyriar deleted the tyriar/lazy_value branch September 23, 2022 16:33
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants